using System;
namespace _022_编程题
{
class Program
{
static void Main(string[] args)
{
//int n = Convert.ToInt32(Console.ReadLine());
//int sum = n;
//while (n != 0)
//{
// n = Convert.ToInt32(Console.ReadLine());
// sum += n;
//}
//Console.WriteLine(sum);
int n = 0;
int sum = 0;
do
{
n = Convert.ToInt32(Console.ReadLine());
sum += n;
} while (n != 0);
Console.WriteLine(sum);
}
}
}