#include using namespace std; int main() { int N; while (cin >> N) { if (N == 0) { break; } int result = 0; int val; for (int i = 0; i < N; i++) { cin >> val; result += val; } cout << result << endl; } return 0; }