count repeated characters in string using java hashmap