import sys
# m=sys.stdin.readline().rstrip().split()
# w=sys.stdin.readline().rstrip().split()
# h=sys.stdin.readline().rstrip().split()
m=[20, 40, 60, 80, 100]
w=[0, 1, 2, 3, 4]
h=[1,0]
possible=[500, 1000, 1500, 2000, 2500]
def computeScore():
    score=(100*float(h[0])-(50*float(h[1])))
    for i in range(0,5):
        score=score +max(.3*float(possible[i]), (1-(float(m[i])/250))*float(possible[i])-(50*float(w[i])) )
    print score

computeScore()
