#include<iostream> using namespace std; int main(){ unsigned long int sum=0; while(1){ int n; cin>>n; if(n==0){ break; } sum+=n; } cout<<sum; }