Create Parser.java

Parsing the input string to be able to do some counting.