[java] How to check how many letters are in a string in java?