while True: try: res = list(map(int, input().split())) num2 = res[0] if num2 == 0: break else: ans = sum(res[1:num2+1]) print(ans) except: break