Karp counter