#include<stdio.h>
int main(){
int sum=0,i,cost,n;
int depoit=0,flag=1;
for(i=1;i<=12;i++){
scanf("%d",&cost);
sum=sum+300-cost;
if(sum>=100){
n=sum/100;
depoit=depoit+100*n;
sum=sum%100;
}
if(sum<0){flag=0;
break;
}
}
if(flag) printf("%d",sum+1.2*depoit);
else printf("%d",-i);
return 0;
}