def P1089():
cost_list = []
for month in range(12):
cost_list.append(int(input().strip()))
left_money = 0
mom_money = 0
for pos, cost in enumerate(cost_list):
left_money = left_money + 300 - cost
if left_money < 0:
print(-(pos + 1))
return
else:
mom_money += int(left_money / 100) * 100
left_money = left_money % 100
print(mom_money * 1.2 + left_money)
P1089()