counting lines of inputfile for error messages