For centuries, Catholic priests wrote about how to subdue it. Some historians surmise Martin Luther had it, along with several renowned saints.
When he was in seventh grade, Cole M., now 23, saw an episode of "20/20" and surmised he had obsessive compulsive disorder, though he didn't the exact name of his disorder: scrupulosity.
Scrupulosity is a rare form of obsessive compulsive disorder focused on prayers, rituals or thoughts rather than the more common germ-phobia and compulsive hand washing.
"Whatever thing that is most important to you, that's what the obsessive compulsive disorder will grab," Cole said his therapist once told him. "My No. 1 fear was that I was going to become an evil person."
Cole, who asked that ABC News not use his last name, agreed to share his struggle with scrupulosity so that others might recognize it and get help.
Family and friends often have no idea that someone is suffering from scrupulosity, because it often manifests in silent rituals of the mind, says Simon Rego, associate director of psychology training at the Montefiore Medical Center in New York City.
Before he got treatment, Cole silently kept a ritual of finding the number seven in places and avoiding the number six.
Even during conversations, Cole silently counted, multiplied and added letters in words to make a sum of seven. For instance, take the sentence: The cat is gray. In less than a second Cole has an answer:
"Cat plus gray equals seven letters. The and is equals five," said Cole. "So, in order to get the [second] seven, I'd make the cross of the t count and the dot of the i count."
"Nobody would be able to tell that I'm doing this," Cole said.
Although it took a tremendous amount of mental energy to count during conversations and everyday life, Cole could not stop his consuming attachment to seven and fear of six. He explained the number 777 stuck in his mind from a newspaper classified ad he saw as a child that read "666 SIN 777 GOD."
"I consciously knew that there was nothing wrong with the number six and seven," Cole said.
"We need all the numbers, because otherwise we wouldn't be able to do math," he added with a laugh.
But Cole was still driven to count words, or to go through a 20-minute bowing ritual before religious iconography before going to school, or to never swear. Just like people who have other forms of obsessive compulsive behavior, Cole keeps up his rituals to quiet a fear and get back to his "just right" feeling.
"It's really not about religion and it's not about faith," said Jeff Szymanski, director of psychological services at McLean Hospital's Obsessive Compulsive Disorder Institute in Belmont, Mass.
What begins to drive a person with scrupulosity and with obsessive compulsive disorder are intrusive thoughts, Szymanski said.
"Everyone has intrusive thoughts," Szymanski said. But not everyone attaches a meaning to the thought in a way that spirals into obsessive compulsive behaviors.
"You have a new mother who's bathing a baby and she thinks 'what if I put the baby under the water?'" Szymanski said. "She might just say, 'oh that's weird, why did I think that?' but then she eventually dismisses it."
People with obsessive compulsive disorder can't just dismiss it, says Szymanski. Instead, they start what he calls the "thought-action fusion" process where the person believes that because he or she thought about letting the baby slip under the water, there's a chance he or she will lose control and do it.
After giving so much credence to a thought, a person with obsessive compulsive disorder tries to suppress it.
"When you try to push a thought away, they come back," said Szymanski. "But you tell someone 'don't think about pink elephants,' and the first thing you do is think about pink elephants."
In reaction, a person with scrupulosity or obsessive compulsive disorder will compulsively do something to temporarily counter this feeling like pray, bow or confess.
"But that little drop in anxiety in your compulsive behavior actually reinforces the anxiety the next time," said Szymanski.
To stop the obsessive compulsive spiral, therapists don't even try to stop the thoughts. They just try to sap the fear from the intrusive thought -- a difficult undertaking when the fear is of eternal damnation instead of germs or contamination.
"When you're talking about the possibility of someone going to hell, that is something that is just very difficult to challenge someone on," said Elyssa Kushner, a psychologist with the Center for the Treatment and Study of Anxiety at the University of Pennsylvania School of Medicine.
"That's where it becomes very tricky," Kushner said.
Obsessive compulsive disorder strikes less than 3 percent of the population, and only 10 percent of those with obsessive compulsive disorder also suffer from scrupulosity.
To use the standard exposure-response obsessive compulsive disorder treatment with someone who has scrupulosity, the therapy can sometimes appear blasphemous. For instance, some orthodox Jewish scrupulosity patients have been forced to sleep with a sandwich bag of bacon.
To treat Cole's scrupulosity, his therapist made him sit and write hundreds of sixes without writing a single seven. Then he took Cole on a field trip and forced him to litter.
"He took a piece of paper out of the trash and tore it in half and threw it on the ground, then gave the other half to me," Cole said. "I was really upset. I don't want to litter."
Cole's therapist even made him swear.
"He had me occasionally curse in these therapy sessions," Cole said. "I told him to screw himself, but it was actually a stronger word than that."
But for all the personal distress a person with scrupulosity faces in treatment, they have a fraction of a chance of adequately controlling their obsessive compulsive behavior.
"Two-thirds of people who go through treatment will see about 50 percent or more of reduction symptoms," Rego said.
Cole, who briefly studied scrupulosity in graduate school, knows this reality all too well.
Before his treatment he would occasionally have panic attacks when people around him used too many swear words. Once in college, he even broke down sobbing in a hallway.
"My sophomore year of college, it was just culture shock," Cole said. Once in a dance class, his classmates wanted to do a number to a song with very suggestive lyrics and sexually suggestive moves.
"I walked out of class and I sank down in the hallway sobbing because I felt dirty. When my friend came by and asked what was wrong, in response I screamed and I screamed," Cole said. "I was trying to find some way to verbalize the stress I was feeling."
Today Cole feels much more comfortable with his scrupulosity and even talking about the battling thoughts in the back of his mind.
"Because I no longer turn my focus to it, it doesn't get loud," Cole said. "It's always going to be there whispering, but I don't have to listen to it."