Method 1 : Read the whole input into a string (Note NOT a String) then use the strtok() function to extract the piece that you want, delimited by semi-colons, then use the the atio() function to turn it into an integer.
Method 2 :Read the bytes as they arrive, count the semi-colons so that you know where you are and save the bytes that you want in a char array terminated by a null to turn it into a string, then use the the atio() function to turn it into an integer.