A word count in java