#include <stdio.h>
int
main (void)
{
FILE *birdfile;
int birds, days, total, i, j, status;
birdfile = fopen ("birds.txt", "r");
total = 0;
status = fscanf (birdfile, "%d", &days);
while (status != EOF)
{
for (j=1; j<=days; ++j)
{
fscanf (birdfile, "%d", &birds);
total = total + birds;
}
status = fscanf (birdfile, "%d", &days);
}
fclose (birdfile);
printf ("Total number of birds sighted: %d\n", total);
return(0);
}