count number of same characters in a string java