java
import java.util.*;
class UnhappyDeJingJing {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int []a = new int[12];
int sum=0;
int mother=0;
int count=0;
for(int i = 0;i<12;i++){
a[i] = sc.nextInt();
int b = (sum+300)-a[i];
if(b>=0 ){
int c=b/100;
if(c>0){
b = b -(100*c);
mother = mother +(100*c);
}
sum=b;
}
else{
count++;
System.out.println();
System.out.println("-"+(i+1));
break;
}
}
if(count==0){
sum = sum + (int)(mother*1.2);
System.out.println();
System.out.println(sum);
}
}
}