How to detect obsessive-compulsive behavior