a = int(input()) c = 0 for i in range(a): i = i + 1 b = int(input()) c = c + b if c >= 1000: break print(c)