counting & hashmap