#include<iostream>
#include<cstdio>
using namespace std;
int jud,sto,pre;
int i=0;
int main()
{
int pre=0;
while(++i<=12)
{
scanf("%d",&jud);
if(300+pre-jud>=100)
{
sto=sto+(300+pre-jud)/100*100;
pre=(300+pre-jud)%100;
}
else if(300+pre-jud<0)
{
printf("%d\n",0-i);
return 0;
}
else
pre=300+pre-jud;
}
sto=pre+sto*1.2;
cout<<sto<<endl;
}
#include<cstdio>
using namespace std;
int jud,sto,pre;
int i=0;
int main()
{
int pre=0;
while(++i<=12)
{
scanf("%d",&jud);
if(300+pre-jud>=100)
{
sto=sto+(300+pre-jud)/100*100;
pre=(300+pre-jud)%100;
}
else if(300+pre-jud<0)
{
printf("%d\n",0-i);
return 0;
}
else
pre=300+pre-jud;
}
sto=pre+sto*1.2;
cout<<sto<<endl;
}