a = 0
n = int(input())
for i in range(n):
    vsp = int(input())
    if a < 1000:
        a += vsp
print(a)