You could read an entire line into a char array, then process it from there, instead of using "unget".
So, for example, you could, say...
Code:
int i, len, numVerts = 0;
char buffer[10000];
infile.getline(buffer, 10000, '\n');
len = strlen(buffer);
for(i=0; i<len; i++){
//do your counting here
}
//all your data in that line is now in "buffer"
//say if you would still like to read the data as a stream, then you could use the class
//strstream
istrstream in(buffer);
//you could read from the stream "in" in the same way as you do from "infile".