a = [] for i in range(int(input())): a.append(int(input())) c = 0 for i in a: c = c+i if c>1000: break print(c)