if you mean instructions, delimited by ';', just count the number of ';' in the file, you can use fscanf to do it.
If you mean the number o lines in the file count the number of '\n'.
To know if you have reached the end of the file compare the result of fscanf with EOF, end of file.