#include <iostream> using namespace std; const int maxn=105; int a[maxn]; int main(){ while(true){ int n; cin>>n; if(n==0) break; int sum=0; for(int i=1;i<=n;++i){ cin>>a[i]; sum+=a[i]; } cout<<sum<<endl; } }