package com.javarush.task.task04.task0442;
import java.io.*;
/*
Суммирование
*/
public class Solution {
public static void main(String[] args) throws Exception {
//напишите тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while(true) {
int b = 0;
String z = reader.readLine();
int a = Integer.parseInt(z);
if(a == -1){
System.out.println(b);
break;
}
else {
b = b + a;
}
}
}
}