OVERAGE = 1000
N_count = int(input()) #количество доступных товаров
for i in range(N_count):
    OVERAGE -= int(input())
print(abs(OVERAGE))