countPairs