init a counter open the file and read it line by line split each line on space to get an array of the fvalue and svalue increment the counter if fvalue is within the range AND svalue is within the range close the file