#include <stdio.h>

main(int argc, char *argv[])
{
  FILE *fopen(), *datafile;
  char word[15];
  int n,i;
  long num;

  datafile = fopen(argv[1],"r");
  num=23456;
  i=0;
  while ((n=fgetword(datafile,15,word))!=0 && n<15){
    sscanf(word,"%ld",&num);
    if(num==1)
      i+=1;
  }
  printf("%d\n",i);
  if (n==0 && num==23456)
    printf("The input file was empty!");
  else if (n>=15){
    printf("There is something wrong with the input file.  ");
    printf("Found number longer than 15 digits!\n");
  }
  fclose(datafile);
}
