n = (int(input()))
Sum  = 0
for i in range(n):
    product = int(input())
    Sum += product
    if (Sum >= 1000):
        break
print(Sum)