#include <stdio.h>
#include <errno.h>
int main(int argc, const char *argv[])
{
FILE *fd=fopen(argv[1],"r");
if(fd==NULL)
{
perror("fopen");
return -1;
}
char c;
int count=0;
while(1)
{
c=fgetc(fd);
if(c==EOF)
{
perror("fgetc");
printf("%d\n",count);
return -1;
}
if(c=='\n')
{
count++;
}
}