On line 1 when reading "12.4find" the first time it reads the line it reads the 12.4 and converts it to a float(? or double you don't say) and stores it in f.
The next time round the loop the next thing to read is "find", you request that this be converted to a float (or double) which can't be done. At this point the input stream enters an error state and (inputfile >> f) returns false and the loop stops.
If you want to read a file and handle errors then you would be better off reading each line as a std::string and then reading the value out of the string if you can
put line in stringstream
read float from stringstream
total += float
count += 1