#include<bits/stdc++.h>
using namespace std;
//p1089
int main() {
int arry[12];
for (int i = 0; i < 12; i++) {
cin >> arry[i];
}
int temp = 0,ans=0;
for (int j = 0; j < 12; j++) {
int num = 300 + temp - arry[j];//有个temp来记录每次剩下的钱
if (num >= 0) {
if (num / 100 > 0) {
temp = num % 100;//存完整百剩下的钱
ans += num / 100;//存几百 ans就加几
}
else
temp = num;
}
else {
cout << "-" << j+1 << endl;//只要那个月缺钱就输出那个月 如何直接return 0
system("pause");
return 0;
}
}
int sum = ans * 120 + temp;//存的钱加上利息加上最后一个月剩的钱
cout << sum << endl;
system("pause");
return 0;
}