Arithmomania
Arithmomania is a mental disorder that may be seen as an expression of obsessive–compulsive disorder. Individuals experiencing this disorder have a strong need to count their actions or objects in their surroundings.
For example, individuals with arithmomania may feel compelled to count steps while climbing or descending stairs or to tally the number of letters in words. They often feel compelled to repeat an action a specific number of times to avert a perceived catastrophe. Other examples include counting tiles on floors or ceilings, lines on highways, or touching objects a specific number of times, such as doorknobs or tables.
Arithmomania sometimes develops into a complex system in which the person assigns values or numbers to people, objects and events in order to deduce their coherence. Sometimes numbers are linked to the past events and the person remembers the events again and again by particular numerical values. One performs their actions a particular number of times, and this number is linked to their particular satisfied event. Counting may be done aloud or in thought.