N = int(input()) goods = [] for i in range(N): goods.append(int(input())) result = sum(goods) if result >= 1000: break print(result)