n, i = map(int, input().split())s = 0while i%2 != 0 and n != 0:s += in, i = map(int, input().split())print(s)
n, i = map(int, input().split())
s = 0
while i%2 != 0 and n != 0:
s += i
n, i = map(int, input().split())
print(s)