#include<iostream> #include<string> using namespace std; int main(){ int a, b; int total; while(cin>>a && a != 0){ total = 0; for(int i = 0; i < a; i++){ cin>>b; total += b; } cout<<total<<endl; } }