#include <stdio.h>
#include <stdlib.h>

int sum(FILE fp)
{
    int s = 0, i;

    while (geth(fp) != EOF)
    {
        i = gets(fp);
        s = s + i;
    }

    return s;
}

int main()
{
    FILE *fp;
    fp = fopen("input.txt", "a");
    a = sum(fp);
    printf("%d", a);
    fclose(fp);
}