include<iostream> using namespace std; int main(){ int n=0,x,s=0,a,b=0,y=1; for(int i=1;i<=12;i++){ cin>>x; n=n+300-x; if(n>=0){ s+=n/100*100; n%=100; } else if(y){ b=i; y=0; } } a=s*1.2+n; if(y){ cout<<a; }else{ cout<<-b; } return 0; }