input()
s = 0
while s < 1000:
    s += int(input())

print(s)