count number of specific characters in string java