1. JAVA, Till Fischer

/*

 ============================================================================

 Name             : 424 - Integer Inquiry

 Author           : Till Fischer

 Accepted      : yes

 Time         : 0.130

 ============================================================================

 */



import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

import java.math.BigInteger;



public class Main {

    public static void main(String[] args) throws IOException {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

       

        BigInteger a;

        String line = reader.readLine();

        if(line.equals("0"))

            return;

        a = new BigInteger(line);

        while(true) {

            line = reader.readLine();

            if(line.equals("0")) {

                break;

            }

            a = a.add(new BigInteger(line));

        }

            System.out.println(a);

        //always be nice to streams!

        reader.close();

    }

}