// sumLoopEOF.cc  P.Conrad for CISC181 Spring 2007
// Read integers from stdin, one per line, ending with EOF (end of file)
// Output the sum (with no special labels---just a bare number)

#include <iostream>
using namespace std;

int main()
{
  
  // initialize sum and declare variable to hold the input

  int thisNum;
  int sum = 0;

  // read all data from file and calculate sum
  
  cin >> thisNum;
  while ( !cin.eof() ) // eof() is a "member function" for the object cin
    {
      sum += thisNum; // add it in
      cin >> thisNum; // read the next number
    }
  
  // output the result
  cout << sum << endl;

  return 0;
}




