print(sum(filter((0).__lt__, iter(lambda: int(input()), 0))))
def sum_positive_numbers():
total = 0
while (number := int(input())) != 0:
total += max(0, number)
return total
if __name__ == "__main__":
print(sum_positive_numbers())
x = 1
numsum = 0
while x != 0:
x = int(input())
if x >= 1:
numsum += x
print(numsum)