while True: ls = list(map(int,input().split(' '))) if ls == [0]: break else: del ls[0] print(sum(ls))