import math
m=list(map(int, input().split()))
w=list(map(int, input().split()))
a,b=map(int, input().split())
c=a*100-b*50
for i in range(5):
  c+=(max(0.3*(i+1)*500, (1-m[i]/250)*(i+1)*500-50*w[i]))
print(int(c)+1 if math.ceil(c)-c<c-int(c) else int(c))