s=input().split() m,sum=0,0 k=1 for i in range(12): m+=300 m-=int(s[i]) if m<0: k=-(i+1) break f=(m//100)*100 sum+=f m-=f if k<0: print(k) else: print(int(sum+sum*0.2+m))