#include<stdio.h>
int main(void){
int a=0,b=0;
while(1)
{
scanf("%d",&a);
b+=a;
if (!a)break;
}
printf("%d\n",b);
return 0;
}
入力が0で終わり。