count duplicates