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