#include<iostream>
using namespace std;
int flag=1,mom,yu;
int money=0;
int main(){
for(int i=1;i<=12;i++){
money=money+300;
cin>>yu;
if(yu>money){
flag=0;
cout<<"-"<<i;
break;
}
mom=money/100;
money=money%100;
}
if(flag==1){
money=money+mom*100*1.2;
cout<<money;
}
return 0;
}