Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point values of 500, 1000, 1500, 2000, and 2500, respectively. Despite the challenging tasks, Kevin was uncowed and bulldozed through all of them, distinguishing himself from the herd as the best cowmputer scientist in all of Bovinia. Kevin knows his submission time for each problem, the number of wrong submissions that he made on each problem, and his total numbers of successful and unsuccessful hacks. Because Codeforces scoring is complicated, Kevin wants you to write a program to compute his final score.

Codeforces scores are computed as follows: If the maximum point value of a problem is x, and Kevin submitted correctly at minute m but made w wrong submissions, then his score on that problem is $\operatorname{max}(0.3 x,(1 - \frac{m}{250}) x - 50 w)$. His total score is equal to the sum of his scores for each problem. In addition, Kevin's total score gets increased by 100 points for each successful hack, but gets decreased by 50 points for each unsuccessful hack.

All arithmetic operations are performed with absolute precision and no rounding. It is guaranteed that Kevin's final score is an integer.


-----Input-----

The first line of the input contains five space-separated integers m_1, m_2, m_3, m_4, m_5, where m_{i} (0 ≤ m_{i} ≤ 119) is the time of Kevin's last submission for problem i. His last submission is always correct and gets accepted.

The second line contains five space-separated integers w_1, w_2, w_3, w_4, w_5, where w_{i} (0 ≤ w_{i} ≤ 10) is Kevin's number of wrong submissions on problem i.

The last line contains two space-separated integers h_{s} and h_{u} (0 ≤ h_{s}, h_{u} ≤ 20), denoting the Kevin's numbers of successful and unsuccessful hacks, respectively.


-----Output-----

Print a single integer, the value of Kevin's final score.


-----Examples-----
Input
20 40 60 80 100
0 1 2 3 4
1 0

Output
4900

Input
119 119 119 119 119
0 0 0 0 0
10 0

Output
4930



-----Note-----

In the second sample, Kevin takes 119 minutes on all of the problems. Therefore, he gets $(1 - \frac{119}{250}) = \frac{131}{250}$ of the points on each problem. So his score from solving problems is $\frac{131}{250}(500 + 1000 + 1500 + 2000 + 2500) = 3930$. Adding in 10·100 = 1000 points from hacks, his total score becomes 3930 + 1000 = 4930.

Difficulty: EASY

Solutions:
a = []
i = 0
while i < 2:
	b = input().split()
	a.append(b)
	i = i + 1
w = [500, 1000, 1500, 2000, 2500]
i = 0
result = 0
y = input().split()
result = result + 100 * int(y[0])
result = result - 50 * int(y[1])
while i < 5:
	c = 0.3 * w[i]
	d = (1 - int(a[0][i]) / 250) * w[i] - 50 * int(a[1][i])
	result = result + max(c, d)
	i = i + 1
print(int(result))


m = [int(y) for y in input().split()]
v = [int(y) for y in input().split()]
(a, b) = [int(y) for y in input().split()]
ans = 0
score = 500
d = 0
for i in range(1, 6, 1):
	d = (1 - m[i - 1] / 250) * (score * i) - 50 * v[i - 1]
	if d + 1 - int(d) >= 1.5:
		d = int(d + 1)
	ans += int(max(0.3 * (i * score), d))
ans += a * 100
ans -= b * 50
print(ans)


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
res = 0
for i in range(5):
	x = i * 500 + 500
	res += max(0.3 * x, (1 - m[i] / 250) * x - 50 * w[i])
res += hs * 100 - hu * 50
print(int(res))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
rating = [500, 1000, 1500, 2000, 2500]
ans = 0
for i in range(5):
	a = int(0.3 * rating[i])
	d = (1 - m[i] / 250) * rating[i] - 50 * w[i]
	ans += max(a, d)
ans = ans + hs * 100 - hu * 50
print(int(ans))


sc = [1] * 10
mrk = input().split()
for i in range(0, 5):
	mrk[i] = int(mrk[i])
	sc[i] = 500 * (i + 1)
wr = input().split()
for i in range(0, 5):
	wr[i] = int(wr[i])
s = 0
for i in range(0, 5):
	s += max(0.3 * sc[i], (1 - mrk[i] / 250) * sc[i] - 50 * wr[i])
l = input().split()
s += 100 * int(l[0]) - 50 * int(l[1])
print(int(s))


costs = [500, 1000, 1500, 2000, 2500]
m = list(map(int, input().strip().split()))
w = list(map(int, input().strip().split()))
(hs, hu) = map(int, input().strip().split())
ans = 0
for (x, mi, wi) in zip(costs, m, w):
	ans += max(0.3 * x, (1 - mi / 250) * x - 50 * wi)
ans += 100 * hs
ans -= 50 * hu
print(int(ans))


a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
score = c[0] * 100 - c[1] * 50
score += max(0.3 * 500, (1 - a[0] / 250) * 500 - 50 * b[0]) + max(0.3 * 1000, (1 - a[1] / 250) * 1000 - 50 * b[1]) + max(0.3 * 1500, (1 - a[2] / 250) * 1500 - 50 * b[2]) + max(0.3 * 2000, (1 - a[3] / 250) * 2000 - 50 * b[3]) + max(0.3 * 2500, (1 - a[4] / 250) * 2500 - 50 * b[4])
score = int(score)
print(score)


import itertools as it
import functools
import operator
import collections
import math
import sys

def solve(ms, ws, hs, hu):
	pts = [500 * i for i in [1, 2, 3, 4, 5]]
	res = 0
	for (x, m, w) in zip(pts, ms, ws):
		res += max(3 * x // 10, x - m * x // 250 - 50 * w)
	res += 100 * hs
	res -= 50 * hu
	return res

def main():
	ms = list(map(int, input().split()))
	ws = list(map(int, input().split()))
	(hs, hu) = map(int, input().split())
	result = solve(ms, ws, hs, hu)
	print(result)
main()


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(sh, uh) = list(map(int, input().split()))
sc = 0
mp = [500, 1000, 1500, 2000, 2500]
for i in range(len(m)):
	x = mp[i]
	y = (1 - m[i] / 250) * x - 50 * w[i]
	sc += max(0.3 * x, y)
print(int(sc + sh * 100 - uh * 50))


import sys
m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
x = [500, 1000, 1500, 2000, 2500]
ans = hs * 100 - hu * 50
for i in range(5):
	ans += max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * w[i])
print(int(ans))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
q = [500, 1000, 1500, 2000, 2500]
s = 0
for i in range(5):
	s += max(0.3 * q[i], (1 - m[i] / 250) * q[i] - 50 * w[i])
(h1, h2) = list(map(int, input().split()))
s += 100 * h1
s -= 50 * h2
print(int(s))


l_m = list(map(int, input().split()))
l_w = list(map(int, input().split()))
l_h = list(map(int, input().split()))
t = 0
for i in range(1, len(l_m) + 1):
	t += max(0.3 * 500 * i, (1 - l_m[i - 1] / 250) * 500 * i - 50 * l_w[i - 1])
print(int(t + l_h[0] * 100 - l_h[1] * 50))


def score(m, w, x):
	return max(0.3 * x, (1.0 - m / 250) * x - 50 * w)
ms = list(map(int, input().split()))
ws = list(map(int, input().split()))
(hs, hu) = list(map(int, input().split()))
score = sum((score(m, w, x) for (m, w, x) in zip(ms, ws, [500, 1000, 1500, 2000, 2500])))
print(int(score + 100 * hs - 50 * hu))


m = [int(i) for i in input().split(' ')]
w = [int(i) for i in input().split(' ')]
(hs, hu) = [int(i) for i in input().split(' ')]
score = 0
for i in range(5):
	score += max(0.3 * 500 * (i + 1), (1 - m[i] / 250) * (500 * (i + 1)) - 50 * w[i])
score += 100 * hs
score -= 50 * hu
print(int(score))


import re
m = [int(n) for n in re.split('\\s+', input())]
w = [int(n) for n in re.split('\\s+', input())]
h = [int(n) for n in re.split('\\s+', input())]
x = [500, 1000, 1500, 2000, 2500]
print(int(sum(list(map(lambda i: max(0.3 * i[0], (1 - i[1] / 250) * i[0] - 50 * i[2]), [i for i in zip(x, m, w)]))) + (h[0] * 100 - h[1] * 50)))


mList = list(map(int, input().split()))
wList = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
prob = [500, 1000, 1500, 2000, 2500]
res = 0
for i in range(len(wList)):
	res += max(0.3 * prob[i], (1 - mList[i] / 250) * prob[i] - 50 * wList[i])
res = res + hs * 100 - hu * 50
print(int(res))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(s, u) = map(int, input().split())
x = [500, 1000, 1500, 2000, 2500]
score = 0
for i in range(5):
	score += max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * w[i])
score += 100 * s
score -= 50 * u
print(int(score))


m = input().split()
w = input().split()
h = input().split()
s = 0
for i in range(5):
	s = s + max(0.3 * 500 * (i + 1), (1 - int(m[i]) / 250) * 500 * (i + 1) - 50 * int(w[i]))
s = s + int(h[0]) * 100 - int(h[1]) * 50
print(int(s))


print(sum([sum(x) for x in [[sum(x) for x in [[int(ans + c[0] * 100 - c[1] * 50) for c in [[int(x) for x in input().split()]]]]] for ans in [sum([sum(x) for x in [[max(0.3 * (500 * (i + 1)), (1 - a[i] / 250) * (500 * (i + 1)) - 50 * b[i]) for i in range(5)] for (a, b) in zip([[int(x) for x in input().split()]], [[int(x) for x in input().split()]])]])]]]))


m = [int(x) for x in input().split()]
w = [int(x) for x in input().split()]
(x, y) = [int(x) for x in input().split()]
z1 = max(0.3 * 500, (1 - m[0] / 250) * 500 - 50 * w[0])
z2 = max(0.3 * 1000, (1 - m[1] / 250) * 1000 - 50 * w[1])
z3 = max(0.3 * 1500, (1 - m[2] / 250) * 1500 - 50 * w[2])
z4 = max(0.3 * 2000, (1 - m[3] / 250) * 2000 - 50 * w[3])
z5 = max(0.3 * 2500, (1 - m[4] / 250) * 2500 - 50 * w[4])
print(int(z1 + z2 + z3 + z4 + z5 + x * 100 - y * 50))


(x1, x2, x3, x4, x5) = (500, 1000, 1500, 2000, 2500)
score = 0
(m1, m2, m3, m4, m5) = map(int, input().split())
(w1, w2, w3, w4, w5) = map(int, input().split())
(hs, hu) = map(int, input().split())
score += max(0.3 * x1, (1 - m1 / 250) * x1 - 50 * w1)
score += max(0.3 * x2, (1 - m2 / 250) * x2 - 50 * w2)
score += max(0.3 * x3, (1 - m3 / 250) * x3 - 50 * w3)
score += max(0.3 * x4, (1 - m4 / 250) * x4 - 50 * w4)
score += max(0.3 * x5, (1 - m5 / 250) * x5 - 50 * w5)
score += hs * 100 - hu * 50
print(int(score))


import sys
mn = list(map(int, sys.stdin.readline().split()))
wn = list(map(int, sys.stdin.readline().split()))
(hs, hu) = map(int, sys.stdin.readline().split())
xn = [1, 2, 3, 4, 5]
ans = 0
for i in range(5):
	ans += max(150 * xn[i], 500 * xn[i] - 2 * mn[i] * xn[i] - 50 * wn[i])
ans += hs * 100 - hu * 50
print(ans)


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))


minute = input()
minute = list(minute.split())
tries = input()
tries = list(tries.split())
hacks = input()
hacks = list(hacks.split())
score = 0
for i in range(5):
	ex = max(0.3 * (i + 1) * 500, (1 - int(minute[i]) / 250) * (500 * (i + 1)) - 50 * int(tries[i]))
	score += ex
score += int(hacks[0]) * 100
score -= int(hacks[1]) * 50
print(int(score))


balli = 0
min_b = [500, 1000, 1500, 2000, 2500]
m_s = [int(x) for x in input().split()]
nev = [int(x) for x in input().split()]
(uvz, nvz) = [int(x) for x in input().split()]
for i in range(5):
	x = min_b[i]
	m = m_s[i]
	w = nev[i]
	balli += max(int(0.3 * x), (1 - m / 250) * x - 50 * w)
balli += 100 * uvz
balli -= 50 * nvz
print(int(balli))


m = list(map(int, input().split(' ')))
w = list(map(int, input().split(' ')))
h = list(map(int, input().split(' ')))
x = [500, 1000, 1500, 2000, 2500]
res = 0
for (i, j, y) in zip(m, w, x):
	res += max(0.3 * y, (1 - i / 250) * y - 50 * j)
res += 100 * h[0]
res -= 50 * h[1]
print(int(res))


M = input().split()
for i in range(5):
	M[i] = int(M[i])
W = input().split()
for i in range(5):
	W[i] = int(W[i])
h = input().split()
for i in range(2):
	h[i] = int(h[i])

def maxim(a, b):
	if a >= b:
		return a
	else:
		return b
res = 0
x = 500
for i in range(5):
	res1 = 0.3 * x
	res2 = (1 - M[i] / 250) * x - 50 * W[i]
	res = res + maxim(res1, res2)
	x += 500
res += h[0] * 100
res -= h[1] * 50
print(int(res))


import sys
x = [500, 1000, 1500, 2000, 2500]
m = list(map(int, sys.stdin.readline().split()))
w = list(map(int, sys.stdin.readline().split()))
(hs, hu) = map(int, sys.stdin.readline().split())
ans = sum([max(3 * xi // 10, xi - mi * xi // 250 - 50 * wi) for (xi, mi, wi) in zip(x, m, w)])
print(ans + 100 * hs - 50 * hu)


p = [500, 1000, 1500, 2000, 2500]
r = lambda : list(map(int, input().split()))
score = 0
for (x, m, w) in zip(p, r(), r()):
	score += max(0.3 * x, (1 - m / 250) * x - 50 * w)
(hack, hack_wrong) = r()
score += 100 * hack - 50 * hack_wrong
print(int(score))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
hsu = list(map(int, input().split()))
num = 0
for i in range(5):
	num += max((i + 1) * 500 * 0.3, (1.0 - m[i] / 250.0) * (i + 1) * 500.0 - 50.0 * w[i])
num += hsu[0] * 100
num -= hsu[1] * 50
print(int(num))


def calculateScore(t, w, hs, hu):
	maxScore = [500, 1000, 1500, 2000, 2500]
	score = 0
	for i in range(5):
		score += max(0.3 * maxScore[i], (1 - t[i] / 250) * maxScore[i] - 50 * w[i])
	return int(score + hs * 100 - hu * 50)
(t1, t2, t3, t4, t5) = input().split()
(t1, t2, t3, t4, t5) = (int(t1), int(t2), int(t3), int(t4), int(t5))
(w1, w2, w3, w4, w5) = input().split()
(w1, w2, w3, w4, w5) = (int(w1), int(w2), int(w3), int(w4), int(w5))
(hs, hu) = input().split()
(hs, hu) = (int(hs), int(hu))
t = [t1, t2, t3, t4, t5]
w = [w1, w2, w3, w4, w5]
score = calculateScore(t, w, hs, hu)
print(score)


import sys
input = iter(sys.stdin.read().splitlines()).__next__
sys.setrecursionlimit(10000)
M = list(map(int, input().split()))
W = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
X = [500, 1000, 1500, 2000, 2500]
score = 0
for i in range(5):
	score += max(3 * X[i] // 10, (250 - M[i]) * X[i] // 250 - 50 * W[i])
score += hs * 100 - hu * 50
print(score)


Scores = [500, 1000, 1500, 2000, 2500]
Time = list(map(int, input().split()))
Wrong = list(map(int, input().split()))
SUM = 0
for i in range(5):
	SUM += max(0.3 * Scores[i], (1 - Time[i] / 250) * Scores[i] - 50 * Wrong[i])
Hack = list(map(int, input().split()))
print(int(SUM + Hack[0] * 100 - Hack[1] * 50))


import sys
input_file = sys.stdin
times = list(map(int, input_file.readline().rstrip().split()))
wr_sub = list(map(int, input_file.readline().rstrip().split()))
hacks = list(map(int, input_file.readline().rstrip().split()))
sum = 0
for index in range(5):
	opt = (index + 1) * 500
	sum += max(0.3 * opt, (1 - times[index] / 250) * opt - 50 * wr_sub[index])
sum += hacks[0] * 100
sum -= hacks[1] * 50
print(int(sum))


(a, b, c, d, e) = map(int, input().split())
(w_a, w_b, w_c, w_d, w_e) = map(int, input().split())
(succ_hack, fail_hack) = map(int, input().split())
res = 0
res += max(0.3 * 500, (1 - a / 250) * 500 - 50 * w_a)
res += max(0.3 * 1000, (1 - b / 250) * 1000 - 50 * w_b)
res += max(0.3 * 1500, (1 - c / 250) * 1500 - 50 * w_c)
res += max(0.3 * 2000, (1 - d / 250) * 2000 - 50 * w_d)
res += max(0.3 * 2500, (1 - e / 250) * 2500 - 50 * w_e)
res += succ_hack * 100
res -= fail_hack * 50
print(int(res))


a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [500, 1000, 1500, 2000, 2500]
d = [int(i) for i in input().split()]
i = 0
sum = 0
while i < 5:
	sum += max(0.3 * c[i], (1 - a[i] / 250) * c[i] - 50 * b[i])
	i += 1
sum += d[0] * 100 - d[1] * 50
print(int(sum), end='')


z = list(map(int, input().split()))
x = list(map(int, input().split()))
c = list(map(int, input().split()))
a = sum([max(0.3 * (500 * (i + 1)), (1 - z[i] / 250) * (500 * (i + 1)) - 50 * x[i]) for i in range(5)])
print(int(a + c[0] * 100 - c[1] * 50))


from sys import stdin
times = stdin.readline().rstrip().split(' ')
times = [int(t) for t in times]
wrong_submissions = stdin.readline().rstrip().split(' ')
wrong_submissions = [int(t) for t in wrong_submissions]
hacks = stdin.readline().rstrip().split(' ')
hacks = [int(t) for t in hacks]
score = 100 * hacks[0] - 50 * hacks[1]
for i in range(5):
	x = 500 * (i + 1)
	score += max(0.3 * x, (1 - times[i] / 250) * x - 50 * wrong_submissions[i])
print(int(score))


import unittest
import sys

class Forces:

	def __init__(self, test_inputs=None):
		it = iter(test_inputs.split('\n')) if test_inputs else None

		def uinput():
			return next(it) if it else sys.stdin.readline().rstrip()
		self.numm = list(map(int, uinput().split()))
		self.numw = list(map(int, uinput().split()))
		[self.hs, self.hu] = map(int, uinput().split())
		self.mx = [500, 1000, 1500, 2000, 2500]

	def calculate(self):
		result = 0
		for i in range(5):
			x = self.mx[i]
			m = self.numm[i]
			w = self.numw[i]
			result += max(0.3 * x, (1 - m / 250) * x - 50 * w)
		result += 100 * self.hs - 50 * self.hu
		return str(int(result))

class unitTests(unittest.TestCase):

	def test_single_test(self):
		test = '20 40 60 80 100\n0 1 2 3 4\n1 0'
		d = Forces(test)
		self.assertEqual(d.numw, [0, 1, 2, 3, 4])
		self.assertEqual(Forces(test).calculate(), '4900')
		test = '119 119 119 119 119\n0 0 0 0 0\n10 0'
		self.assertEqual(Forces(test).calculate(), '4930')
		test = ''
		test = ''

	def time_limit_test(self, nmax):
		import random
		import timeit
		test = str(nmax) + ' ' + str(nmax) + '\n'
		numnums = [str(i) + ' ' + str(i + 1) for i in range(nmax)]
		test += '\n'.join(numnums) + '\n'
		nums = [random.randint(1, 10000) for i in range(nmax)]
		test += ' '.join(map(str, nums)) + '\n'
		start = timeit.default_timer()
		d = Forces(test)
		calc = timeit.default_timer()
		d.calculate()
		stop = timeit.default_timer()
		print('\nTimelimit Test: ' + '{0:.3f}s (init {1:.3f}s calc {2:.3f}s)'.format(stop - start, calc - start, stop - calc))
sys.setrecursionlimit(100000)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
sys.stdout.write(Forces().calculate())


x = [500, 1000, 1500, 2000, 2500]
m = str(input()).split()
w = str(input()).split()
h = str(input()).split()
m = [int(xx) for xx in m]
w = [int(ww) for ww in w]
h = [int(hh) for hh in h]

def problem_score(xx, mm, ww):
	score_a = 0.3 * xx
	score_b = (1 - mm / 250) * xx - 50 * ww
	return max(score_a, score_b)
score = 0
for i in range(0, len(m)):
	score += problem_score(x[i], m[i], w[i])
for i in range(0, h[0]):
	score += 100
for i in range(0, h[1]):
	score -= 50
print(int(score))


get_grade = lambda x, m, w: max(int(0.3 * x), int((250 - m) * x / 250 - 50 * w))
(m1, m2, m3, m4, m5) = map(int, input().split(' '))
(w1, w2, w3, w4, w5) = map(int, input().split(' '))
(hs, hu) = map(int, input().split(' '))
result = 100 * hs - 50 * hu
result += get_grade(500, m1, w1)
result += get_grade(1000, m2, w2)
result += get_grade(1500, m3, w3)
result += get_grade(2000, m4, w4)
result += get_grade(2500, m5, w5)
print(result)


M = list(map(int, input().split()))
W = list(map(int, input().split()))
(s, e) = list(map(int, input().split()))
P = [500, 1000, 1500, 2000, 2500]
r = 0
for k in range(5):
	r += max([0.3 * P[k], (1 - M[k] / 250) * P[k] - 50 * W[k]])
print(int(r + 100 * s - 50 * e))


(m1, m2, m3, m4, m5) = map(int, input().split())
(w1, w2, w3, w4, w5) = map(int, input().split())
(hs, hu) = map(int, input().split())
ans = 0
ans += max(0.3 * 500, (1 - m1 / 250) * 500 - 50 * w1)
ans += max(0.3 * 1000, (1 - m2 / 250) * 1000 - 50 * w2)
ans += max(0.3 * 1500, (1 - m3 / 250) * 1500 - 50 * w3)
ans += max(0.3 * 2000, (1 - m4 / 250) * 2000 - 50 * w4)
ans += max(0.3 * 2500, (1 - m5 / 250) * 2500 - 50 * w5)
ans += 100 * hs - 50 * hu
print(int(ans))


I = lambda : map(int, input().split())
points = sum((max(150 * i, (500 - 2 * m) * i - 50 * w) for (i, m, w) in zip(range(1, 6), I(), I())))
(hs, hu) = I()
print(points + 100 * hs - 50 * hu)


mi = map(int, input().split())
minutes = list(mi)
wr = map(int, input().split())
wrong = list(wr)
(hs, hu) = map(int, input().split())
max_point = [500, 1000, 1500, 2000, 2500]
score = 0

def Score_law(x, m, w):
	fir = 0.3 * x
	sec = abs((1 - m / 250) * x) - 50 * w
	law = max(fir, sec)
	return law

def getHacks(hs, hu):
	suc_hack = hs * 100
	unsuc_hack = hu * 50
	hack_score = suc_hack - unsuc_hack
	return hack_score
for i in range(5):
	x = max_point[i]
	m = minutes[i]
	w = wrong[i]
	score += Score_law(x, m, w)
hack_score = getHacks(hs, hu)
total_Score = int(score + hack_score)
print(total_Score)


n = 5
s = [500, 1000, 1500, 2000, 2500]
m = []
ln = input('').split(' ')
for i in range(n):
	m.append(int(ln[i]))
w = []
ln = input('').split(' ')
for i in range(n):
	w.append(int(ln[i]))
ans = 0
(sh, uh) = [int(z) for z in input('').split()]
for i in range(n):
	v1 = 0.3 * s[i]
	v2 = s[i] - m[i] * s[i] / 250 - 50 * w[i]
	ans += max(v1, v2)
ans += sh * 100 - uh * 50
print(int(ans))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
h = list(map(int, input().split()))
s = [500, 1000, 1500, 2000, 2500]
sum = 0
for i in range(5):
	f = 0.3 * int(s[i])
	l = (1 - m[i] / 250) * int(s[i]) - 50 * w[i]
	if f > l:
		sum += f
	else:
		sum += l
sum += h[0] * 100 - h[1] * 50
print(int(sum))


p = (500, 1000, 1500, 2000, 2500)
a = input().split()
b = input().split()
c = input().split()
s = int(c[0]) * 100 - int(c[1]) * 50
for i in range(5):
	s += max((250 - int(a[i])) * p[i] // 250 - 50 * int(b[i]), p[i] // 10 * 3)
print(s)


m = list(map(int, input().strip().split()))[:5]
w = list(map(int, input().strip().split()))[:5]
(hs, hu) = map(int, input().split())
i = 0
x = 500
ans = 0
while x <= 2500:
	ans += max(0.3 * x, (1 - float(m[i] / 250)) * x - 50 * w[i])
	i += 1
	x += 500
ans += hs * 100 - hu * 50
ans = int(ans)
print(ans)


__author__ = 'suvasish'
import math

def calculate_score(m, w, mxv):
	d = 1 - m / 250
	x3 = 0.3 * mxv
	score = d * mxv - 50 * w
	if score > x3:
		return score
	else:
		return x3
m_lst = list(map(int, input().split(' ')))
w_lst = list(map(int, input().split(' ')))
h_lst = list(map(int, input().split(' ')))
res = 0
mxc = 500
val = []
for i in range(0, 5):
	val.append(calculate_score(m_lst[i], w_lst[i], mxc * (i + 1)))
res = math.fsum(val)
res += h_lst[0] * 100
res -= h_lst[1] * 50
vua = str(res).split('.')
print(vua[0])


scores = [500, 1000, 1500, 2000, 2500]

def cowforces(lst1, lst2, hs, hu):
	total = 0
	for i in range(len(lst1)):
		total += max(3 * scores[i] / 10, (250 - lst1[i]) * scores[i] / 250 - 50 * lst2[i])
	return int(total + hs * 100 - hu * 50)
m = [int(x) for x in input().split()]
w = [int(y) for y in input().split()]
(h_s, h_u) = [int(z) for z in input().split()]
print(cowforces(m, w, h_s, h_u))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hw) = map(int, input().split())
x = [500, 1000, 1500, 2000, 2500]
score = 100 * hs - 50 * hw
for i in range(5):
	a = 0.3 * x[i]
	b = x[i] - 50 * w[i] - m[i] * x[i] // 250
	score += max(a, b)
print(int(score))


parr = [500, 1000, 1500, 2000, 2500]
marr = list(map(int, input().split()))
warr = list(map(int, input().split()))
s = 0
for i in range(5):
	x = parr[i]
	m = marr[i]
	w = warr[i]
	s += max(0.3 * x, (250 - m) * x // 250 - 50 * w)
(hs, hu) = map(int, input().split())
s += 100 * hs
s -= 50 * hu
print(int(s))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
h = list(map(int, input().split()))
score = h[0] * 100 - h[1] * 50
for (i, s) in enumerate([500, 1000, 1500, 2000, 2500]):
	score += max(0.3 * s, (1 - m[i] / 250) * s - 50 * w[i])
print(int(score))


times = list(map(int, input().split()))
att = list(map(int, input().split()))
(n, m) = map(int, input().split())
sc = 0
for i in range(5):
	sc += max(150 * (i + 1), (1 - times[i] / 250) * 500 * (i + 1) - 50 * att[i])
sc += 100 * n
sc -= 50 * m
print(int(sc))


l = list(map(int, input().split()))
w = list(map(int, input().split()))
r = [500, 1000, 1500, 2000, 2500]
(a, b) = map(int, input().split())
k = 0
for i in range(5):
	k = k + max(0.3 * r[i], (1 - l[i] / 250) * r[i] - 50 * w[i])
k = k + a * 100
k = k - b * 50
print(int(k))


points = list((int(x) for x in input().split()))
submission = list((int(x) for x in input().split()))
rowHack = input().split()
successHack = int(rowHack[0])
unSuccessHack = int(rowHack[1])
maxPoints = [500, 1000, 1500, 2000, 2500]
res = [0, 0, 0, 0, 0]
for i in range(5):
	res[i] = max(0.3 * maxPoints[i], (1 - points[i] / 250) * maxPoints[i] - 50 * submission[i])
sumres = sum(res)
sumres = sumres + 100 * successHack - 50 * unSuccessHack
print(int(sumres))


s1 = input()
s2 = input()
(h, h1) = map(int, input().split())
a = s1.split(' ')
b = s2.split(' ')
a = [int(i) for i in a]
b = [int(i) for i in b]
r = 0
for i in range(5):
	x = 500 * (i + 1)
	r = r + max(0.3 * x, (1 - a[i] / 250) * x - 50 * b[i])
r = r + 100 * h - 50 * h1
print(int(r))


m = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
(hs, hw) = map(int, input().split())
r = 50 * (2 * hs - hw)
for i in range(5):
	wt = (i + 1) * 500
	r += max(3 * wt // 10, (250 - m[i]) * wt // 250 - 50 * w[i])
print(r)


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(n1, n2) = map(int, input().split())
ans = n1 * 100 - n2 * 50
for i in range(5):
	col = 500 * (i + 1)
	ans += max(0.3 * col, (1 - m[i] / 250) * col - 50 * w[i])
print(int(ans))


def scanf():
	inp = list(map(int, input().split(' ')))
	if len(inp) == 1:
		return inp[0]
	return inp
m = scanf()
wa = scanf()
(sh, uh) = scanf()
score = sh * 100 + uh * -50
x = [500, 1000, 1500, 2000, 2500]
for i in range(5):
	score += max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * wa[i])
print(int(score))


problems = [500, 1000, 1500, 2000, 2500]
submitted = list(map(int, input().split()))
wrong = list(map(int, input().split()))
score = 0
for (pos, x) in enumerate(problems):
	m = submitted[pos]
	w = wrong[pos]
	score += max(3 * x // 10, x - m * x // 250 - 50 * w)
(good, bad) = map(int, input().split())
score += good * 100 - bad * 50
print(score)


a1 = [int(x) for x in input().split(' ')]
a2 = [int(x) for x in input().split(' ')]
a3 = [int(x) for x in input().split(' ')]
x = [500, 1000, 1500, 2000, 2500]
result = 0

def myFunc(x, m, w):
	result = max(0.3 * x, (1 - m / 250) * x - 50 * w)
	return result
for num in range(5):
	result += myFunc(x[num], a1[num], a2[num])
result += 100 * a3[0] - 50 * a3[1]
print(int(result))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
a = [500, 1000, 1500, 2000, 2500]
v = list(map(int, input().split()))
ans = 0
for i in range(len(m)):
	ans += max(0.3 * a[i], (1 - m[i] / 250) * a[i] - 50 * w[i])
ans += v[0] * 100
ans -= v[1] * 50
print(int(ans))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
h = list(map(int, input().split()))
ans = 0
for i in range(5):
	x = (i + 1) * 500
	ans += max(0.3 * x, (1 - m[i] / 250) * x - 50 * w[i])
ans += 100 * h[0] - 50 * h[1]
print(int(ans))


import sys
time = sys.stdin.readline().split()
time = [int(x) for x in time]
wrongs = sys.stdin.readline().split()
wrongs = [int(x) for x in wrongs]
hacks = sys.stdin.readline().split()
hacks = [int(x) for x in hacks]
maxvals = [500, 1000, 1500, 2000, 2500]
score = 0
for i in range(5):
	score += max(0.3 * maxvals[i], (1 - float(time[i]) / 250) * maxvals[i] - 50 * wrongs[i])
score += 100 * hacks[0]
score -= 50 * hacks[1]
print(int(score))


def n():
	return list(map(int, input().split()))
(m, w, h, r, p) = (n(), n(), n(), 0, [500, 1000, 1500, 2000, 2500])
for i in range(5):
	r += max(0.3 * p[i], (1 - m[i] / 250) * p[i] - 50 * w[i])
r += h[0] * 100 - h[1] * 50
print(int(r))


class CodeforcesTask604ASolution:

	def __init__(self):
		self.result = ''
		self.times = []
		self.subs = []
		self.hacks = []

	def read_input(self):
		self.times = [int(x) for x in input().split(' ')]
		self.subs = [int(x) for x in input().split(' ')]
		self.hacks = [int(x) for x in input().split(' ')]

	def process_task(self):
		scores = [max(0.3 * (x + 1) * 500, (1 - self.times[x] / 250) * ((x + 1) * 500) - 50 * self.subs[x]) for x in range(len(self.subs))]
		self.result = str(int(sum(scores) - self.hacks[1] * 50 + self.hacks[0] * 100))

	def get_result(self):
		return self.result
Solution = CodeforcesTask604ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	m = LI()
	w = LI()
	h = LI()
	r = h[0] * 100 - h[1] * 50
	for i in range(5):
		t = (i + 1) * 500
		a = t // 10 * 3
		b = t - t * m[i] // 250 - w[i] * 50
		r += max(a, b)
	return r
print(main())


def calc(x, m, w):
	score = max(0.3 * x, (1 - m / 250) * x - 50 * w)
	return score
(m1, m2, m3, m4, m5) = map(int, input().split(' '))
(w1, w2, w3, w4, w5) = map(int, input().split(' '))
(h1, h2) = map(int, input().split(' '))
score = calc(500, m1, w1) + calc(1000, m2, w2) + calc(1500, m3, w3) + calc(2000, m4, w4) + calc(2500, m5, w5)
score += h1 * 100
score -= h2 * 50
print(int(score))


import math
succ = [float(i) for i in input().split()]
err = [float(i) for i in input().split()]
hack = [float(i) for i in input().split()]
val = [float(500), float(1000), float(1500), float(2000), float(2500)]
points = 0.0
for i in range(5):
	points = points + max(0.3 * val[i], (1 - succ[i] / 250) * val[i] - 50 * err[i])
points = points + hack[0] * 100 - hack[1] * 50
print(int(points))


ans = 0
time = list(map(int, input().split()))
tries = list(map(int, input().split()))
ball = [500, 1000, 1500, 2000, 2500]
z = list(map(int, input().split()))
gv = z[0]
bv = z[1]
for i in range(0, 5):
	ans += max(0.3 * ball[i], (1 - time[i] / 250) * ball[i] - 50 * tries[i])
ans += 100 * gv
ans -= 50 * bv
print(int(ans))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(ha, hu) = map(int, input().split())
h = [500, 1000, 1500, 2000, 2500]
res = 0.0
for i in range(5):
	res += max(0.3 * h[i], (1.0 - m[i] / 250.0) * h[i] - 50.0 * w[i])
res += ha * 100.0
res -= hu * 50.0
print(int(res))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(h1, h2) = map(int, input().split())
points = 500
output = 0
for i in range(5):
	output += max(0.3 * points, (1 - m[i] / 250) * points - 50 * w[i])
	points += 500
if h1 > 0:
	output += h1 * 100
if h2 > 0:
	output -= h2 * 50
print(int(output))


time = list(map(int, input().split()))
ws = list(map(int, input().split()))
points = [500, 1000, 1500, 2000, 2500]
total_score = 0
(Shacks, Uhacks) = map(int, input().split())
for i in range(5):
	score = max(0.3 * points[i], (1 - time[i] / 250) * points[i] - 50 * ws[i])
	total_score = total_score + score
print(int(total_score + 100 * Shacks - 50 * Uhacks))


m = [int(x) for x in input().split()]
w = [int(x) for x in input().split()]
(s, u) = map(int, input().split())
ans = 0
for i in range(5):
	x = 500 * (i + 1)
	ans += max(0.3 * x, (1 - m[i] / 250) * x - 50 * w[i])
print(int(ans) + 100 * s - 50 * u)


import math
m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hf) = map(int, input().split())
res = 0
x = 500
for i in range(len(m)):
	res += max(0.3 * x, (1 - m[i] / 250) * x - 50 * w[i])
	x += 500
res += hs * 100
res -= hf * 50
print(math.trunc(res))


import sys
arr1 = [int(x) for x in sys.stdin.readline().split()]
arr2 = [int(x) for x in sys.stdin.readline().split()]
base = [500, 1000, 1500, 2000, 2500]
res = 0
for i in range(5):
	res += max([0.3 * base[i], base[i] * (1 - arr1[i] / 250) - 50 * arr2[i]])
(a, b) = [int(x) for x in sys.stdin.readline().split()]
res += 100 * a
res -= 50 * b
print(int(res))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
x = [500, 1000, 1500, 2000, 2500]

def f(m, w, x):
	return max(0.3 * x, (1 - m / 250) * x - 50 * w)
sol = 0
for i in range(5):
	sol += f(m[i], w[i], x[i])
sol += 100 * hs - 50 * hu
sol = int(sol)
print(sol)


a = [500, 1000, 1500, 2000, 2500]
m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
summa = 0
for i in range(len(m)):
	maxbal = max(0.3 * a[i], (1 - m[i] / 250) * a[i] - 50 * w[i])
	summa += maxbal
hs *= 100
hu *= 50
print(int(summa + hs - hu))


x = [500, 1000, 1500, 2000, 2500]
m = list(map(int, input().split()))
w = list(map(int, input().split()))
(sh, uh) = map(int, input().split())
t = 0
for i in range(5):
	t += max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * w[i])
t += sh * 100 - uh * 50
print(int(t))


time = list(map(int, input().split()))
tryes = list(map(int, input().split()))
(luck, fail) = map(int, input().split())
data = [500, 1000, 1500, 2000, 2500]
answer = 0
for i in range(5):
	answer += max(0.3 * data[i], (1 - time[i] / 250) * data[i] - 50 * tryes[i])
answer += luck * 100
answer -= fail * 50
print(int(answer))


m = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
(hp, hf) = map(int, input().split())
sm = 0
x = [500, 1000, 1500, 2000, 2500]
for i in range(5):
	sm += max(x[i] * 0.3, (1 - m[i] / 250) * x[i] - 50 * w[i])
sm += hp * 100
sm -= hf * 50
print(int(sm))


rating = 0
t = list(map(int, input().split()))
w = list(map(int, input().split()))
(hack, unhack) = map(int, input().split())
for i in range(5):
	rating += max(150 * (i + 1), (i + 1) * 500 - t[i] * 2 * (i + 1) - 50 * w[i])
rating += 100 * hack - 50 * unhack
print(rating)


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(a, b) = map(int, input().split())
ans = 0
ans += a * 100 - 50 * b
for i in range(1, 6):
	x = 500 * i
	y = 0.3 * x
	z = (1 - m[i - 1] / 250) * x - 50 * w[i - 1]
	ans += max(y, z)
print(int(ans))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(s, u) = map(int, input().split())
score = 0
for (mi, wi, x) in zip(m, w, [500, 1000, 1500, 2000, 2500]):
	score += max(0.3 * x, (1 - mi / 250) * x - 50 * wi)
score += 100 * s
score -= 50 * u
print(int(score))


def main():
	mode = 'filee'
	if mode == 'file':
		f = open('test.txt', 'r')
	get = lambda : [int(x) for x in (f.readline() if mode == 'file' else input()).split()]
	m = get()
	w = get()
	h = get()
	ans = 0
	s = 500
	for i in range(5):
		ans += max(0.3 * s, (1 - m[i] / 250) * s - 50 * w[i])
		s += 500
	ans += 100 * h[0] - 50 * h[1]
	print(int(ans))
	if mode == 'file':
		f.close()

def __starting_point():
	main()
__starting_point()


m = list(map(int, input().split(' ')))
w = list(map(int, input().split(' ')))
h = list(map(int, input().split(' ')))
x = [500, 1000, 1500, 2000, 2500]
r = []
result = 0
for i in range(5):
	r.append(max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * w[i]))
for i in r:
	result += i
print(int(result + h[0] * 100 - h[1] * 50))


totalScore = 0
minutes = list(map(int, input().split()))
wrongs = list(map(int, input().split()))
(hack1, hack2) = map(int, input().split())
x = [500, 1000, 1500, 2000, 2500]
for i in range(5):
	buffer = max(0.3 * x[i], (1 - minutes[i] / 250) * x[i] - 50 * wrongs[i])
	totalScore += buffer
totalScore += hack1 * 100
totalScore -= hack2 * 50
print(int(totalScore))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
print(sum((max(150 * (i + 1), (i + 1) * 500 - m[i] * (i + 1) * 2 - 50 * w[i]) for i in range(5))) + hs * 100 - hu * 50)


ps = [500, 1000, 1500, 2000, 2500]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
pts = 0
for i in range(5):
	pts += max(0.3 * ps[i], (1 - a[i] / 250) * ps[i] - 50 * b[i])
pts += c[0] * 100
pts -= c[1] * 50
print(int(pts))


I = lambda : map(int, input().split())
m = (*I(),)
w = (*I(),)
(s, u) = I()
p = [500, 1000, 1500, 2000, 2500]
print(sum((max(3 * p[i] // 10, (250 - m[i]) * p[i] // 250 - 50 * w[i]) for i in range(5))) + s * 100 - u * 50)


__author__ = 'MoonBall'
import sys
T = 1

def process():
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = list(map(int, input().split()))
	z = [500, 1000, 1500, 2000, 2500]
	total = 0
	for _ in range(5):
		total += max(0.3 * z[_], (1 - a[_] / 250) * z[_] - 50 * b[_])
	total += 100 * c[0] - 50 * c[1]
	print(int(total))
for _ in range(T):
	process()


def __starting_point():
	x = [500, 1000, 1500, 2000, 2500]
	m = [int(x) for x in input().split()]
	w = [int(x) for x in input().split()]
	(hs, hu) = [int(x) for x in input().split()]
	res = 0
	for i in range(5):
		res += max(3 * x[i] // 10, x[i] - m[i] * x[i] // 250 - 50 * w[i])
	res += 100 * hs
	res -= 50 * hu
	print(res)
__starting_point()


mi = list(map(int, input().split()))
wi = list(map(int, input().split()))
h = list(map(int, input().split()))
score = 0
for (i, m) in enumerate(mi):
	x = (i + 1) * 500
	w = wi[i]
	score += max(0.3 * x, (1 - m / 250) * x - 50 * w)
score += 100 * h[0]
score -= 50 * h[1]
print(int(score))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
x = [500, 1000, 1500, 2000, 2500]
lt = []
for i in range(5):
	lt.append(max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * w[i]))
su = sum(lt)
su += hs * 100 - hu * 50
print(int(su))


def arr_inp():
	return [int(x) for x in input().split()]
score = 0
(m, w) = (arr_inp(), arr_inp())
(hs, hu) = map(int, input().split())
for i in range(5):
	x = (i + 1) * 500
	score += max(0.3 * x, (1 - m[i] / 250) * x - 50 * w[i])
score += 100 * hs - 50 * hu
print(int(score))


t = list(map(int, input().split()))
s = list(map(int, input().split()))
y = list(map(int, input().split()))
o = [500, 1000, 1500, 2000, 2500]
p = 0
for k in range(len(t)):
	p += max(0.3 * o[k], (1 - t[k] / 250) * o[k] - 50 * s[k])
print(int(p + 100 * y[0] - 50 * y[1]))


s = 0
(a, b, c, d, e) = map(int, input().split(' '))
ll = list(map(int, input().split(' ')))
(xx, yy) = map(int, input().split(' '))
pt = [500, 1000, 1500, 2000, 2500]
k = [a, b, c, d, e]
for i in range(5):
	s += max(0.3 * pt[i], (1 - k[i] / 250) * pt[i] - 50 * ll[i])
print(int(s + 100 * xx - 50 * yy))


from fractions import Fraction
mps = [500, 1000, 1500, 2000, 2500]
mins = list(map(int, input().split()))
ws = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
ans = 0
for i in range(5):
	ans += max(Fraction(3, 10) * mps[i], Fraction(250 - mins[i], 250) * mps[i] - 50 * ws[i])
ans += 100 * hs - 50 * hu
print(ans)


import sys
vals = [500, 1000, 1500, 2000, 2500]
time = [int(x) for x in input().split()]
wrong = [int(x) for x in input().split()]
hacks = [int(x) for x in input().split()]
sum = 0
for i in range(5):
	current = max(vals[i] * 0.3, vals[i] - time[i] * vals[i] / 250 - 50 * wrong[i])
	sum += current
sum += hacks[0] * 100 - hacks[1] * 50
print(int(sum))


def points(t, w, x):
	return max(x * 3 // 10, x - x * t // 250 - 50 * w)
p = [500, 1000, 1500, 2000, 2500]
res = 0
t = tuple(map(int, input().split()))
w = tuple(map(int, input().split()))
for i in range(5):
	res += points(t[i], w[i], p[i])
(g, b) = tuple(map(int, input().split()))
res += 100 * g - 50 * b
print(res)


a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
ans = c[0] * 100 - c[1] * 50
for i in range(5):
	ans += max(0.3 * (i + 1) * 500, (1 - a[i] / 250) * (i + 1) * 500 - 50 * b[i])
print(round(ans))


M = list(map(int, input().split()))
W = list(map(int, input().split()))
(t, f) = map(int, input().split())
X = 0
for i in range(5):
	x = (i + 1) * 500
	X += max(0.3 * x, (1 - M[i] / 250) * x - 50 * W[i])
X += t * 100 - f * 50
print(int(X))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(a, b) = map(int, input().split())
c = 0
for i in range(5):
	c += max(0.3 * 500.0 * float(i + 1), (1.0 - float(m[i]) / 250) * 500.0 * float(i + 1) - 50.0 * float(w[i]))
print(int(c) + a * 100 - b * 50)


mxs = range(500, 2501, 500)
mm = list(map(int, input().split()))
tries = list(map(int, input().split()))
hcks = list(map(int, input().split()))
print(int(sum([max(0.3 * x, (1 - m / 250) * x - 50 * w) for (x, w, m) in zip(mxs, tries, mm)]) + 100 * hcks[0] - 50 * hcks[1]))


I = lambda : list(map(int, input().split()))
f = lambda x, m, w: max(0.3 * x, (1 - m / 250) * x - 50 * w)
m = I()
w = I()
h = I()
print(int(h[0] * 100 - h[1] * 50 + sum([f(500 * (i + 1), m[i], w[i]) for i in range(5)])))


from math import *
m = list(map(int, input().split()))
w = list(map(int, input().split()))
hs = 0
hu = 0
o = 0
t = 0
(hs, hu) = map(int, input().split())
for i in range(5):
	x = 500 * (i + 1)
	o += max(0.3 * x, (1 - m[i] / 250) * x - 50 * w[i])
print(int(o + 100 * hs - 50 * hu))


a = list(map(int, input().split()))
l = list(map(int, input().split()))
(su, un) = list(map(int, input().split()))
la = 0
pl = 0
for x in range(5):
	la += 500
	pa = 0.3 * la
	ka = (1 - a[x] / 250) * la - 50 * l[x]
	sam = max(pa, ka)
	pl += sam
da = 100 * su - 50 * un
print(int(pl + da))


max_scores = [500, 1000, 1500, 2000, 2500]
corects = [int(c) for c in input().split()]
wrongs = [int(w) for w in input().split()]
(shacks, unshacks) = map(int, input().split())
final_score = shacks * 100 - unshacks * 50

def score(x, m, w):
	return max(0.3 * x, (1 - m / 250) * x - 50 * w)
for i in range(5):
	final_score += score(max_scores[i], corects[i], wrongs[i])
print(int(final_score))


x = [500, 1000, 1500, 2000, 2500]
m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
print(sum((max(3 * x[i] // 10, x[i] - x[i] * m[i] // 250 - 50 * w[i]) for i in range(5))) + hs * 100 - hu * 50)


m = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
mx = 0
x = [500, 1000, 1500, 2000, 2500]
for i in range(5):
	mx += max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * w[i])
print(int(mx + 100 * h[0] - 50 * h[1]))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(t, f) = map(int, input().split())
s = 0
s += max(0.3 * 500, (1 - m[0] / 250) * 500 - 50 * w[0])
s += max(0.3 * 1000, (1 - m[1] / 250) * 1000 - 50 * w[1])
s += max(0.3 * 1500, (1 - m[2] / 250) * 1500 - 50 * w[2])
s += max(0.3 * 2000, (1 - m[3] / 250) * 2000 - 50 * w[3])
s += max(0.3 * 2500, (1 - m[4] / 250) * 2500 - 50 * w[4])
print(int(s + 100 * t - 50 * f))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
lis = [500, 1000, 1500, 2000, 2500]
score = 0
for (i, j, k) in zip(m, w, lis):
	score += max(0.3 * k, (1 - i / 250) * k - 50 * j)
print(int(score + hs * 100 - hu * 50))


import logging
import copy
import sys
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)

def solve(firstLine, secondLine, thridLine):
	score = 0
	baseScore = [500, 1000, 1500, 2000, 2500]
	for i in range(5):
		x = baseScore[i]
		m = firstLine[i]
		w = secondLine[i]
		score += max([0.3 * x, (1 - m / 250) * x - 50 * w])
	score += 100 * thridLine[0]
	score += -50 * thridLine[1]
	return int(score)

def main():
	firstLine = input().split()
	firstLine = list(map(int, firstLine))
	inputLines = []
	for i in range(2):
		line = input().split()
		line = list(map(int, line))
		inputLines.append(line)
	print(solve(firstLine, inputLines[0], inputLines[1]))

def log(*message):
	logging.debug(message)
main()


def fun(dd, ee, ff):
	return max(0.3 * dd, (1 - ee / 250) * dd - 50 * ff)
mi = list(map(int, input().split()))
wr = list(map(int, input().split()))
(s, us) = map(int, input().split())
ans = 0
aa = [500, 1000, 1500, 2000, 2500]
for i in range(len(mi)):
	k = fun(aa[i], mi[i], wr[i])
	ans += k
ans += s * 100
ans -= us * 50
print(int(ans))


res = 0
c = [500, 1000, 1500, 2000, 2500]
a = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
for i in range(5):
	res += max(0.3 * c[i], (1 - a[i] / 250) * c[i] - 50 * w[i])
print(int(res + hs * 100 - 50 * hu))


maxPoint = [500, 1000, 1500, 2000, 2500]
min = [int(x) for x in input().split(' ')]
wrongTry = [int(x) for x in input().split(' ')]
(hackRight, hackWrong) = [int(x) for x in input().split(' ')]
rez = sum((max(0.3 * maxPoint[i], (1 - min[i] / 250) * maxPoint[i] - 50 * wrongTry[i]) for i in range(5)))
print(int(rez + 100 * hackRight - 50 * hackWrong))


line_m = str(input()).split()
line_m = [int(it) for it in line_m]
line_w = str(input()).split()
line_w = [int(it) for it in line_w]
(h_s, h_u) = str(input()).split()
h_s = int(h_s)
h_u = int(h_u)
base = 0
for i in range(5):
	base += max(150 * (i + 1), (500 - 2 * line_m[i]) * (i + 1) - 50 * line_w[i])
print(base + 100 * h_s - 50 * h_u)


m = input().split()
w = input().split()
(hs, hu) = map(int, input().split())
value = 0
pont = 0
total = 0
for i in range(5):
	value += 500
	spont = 0.3 * value
	pont = (1 - int(m[i]) / 250) * value - 50 * int(w[i])
	if pont > spont:
		total += pont
	else:
		total += spont
total += 100 * hs - 50 * hu
print(int(total))


(s1, s2, s3, s4, s5) = map(int, input().split())
(w1, w2, w3, w4, w5) = map(int, input().split())
(hs, hu) = map(int, input().split())
a1 = max(0.3 * 500, (1 - s1 / 250) * 500 - 50 * w1)
a2 = max(0.3 * 1000, (1 - s2 / 250) * 1000 - 50 * w2)
a3 = max(0.3 * 1500, (1 - s3 / 250) * 1500 - 50 * w3)
a4 = max(0.3 * 2000, (1 - s4 / 250) * 2000 - 50 * w4)
a5 = max(0.3 * 2500, (1 - s5 / 250) * 2500 - 50 * w5)
hacks = hs * 100 - hu * 50
print(int(a1 + a2 + a3 + a4 + a5 + hacks))


minutes = [int(i) for i in input().split()]
tries = [int(i) for i in input().split()]
(hs, hu) = [int(i) for i in input().split()]
amount = 100 * hs - 50 * hu
curr = 0
for i in range(5):
	curr = 500 * (i + 1)
	amount += max(0.3 * curr, (1 - minutes[i] / 250) * curr - 50 * tries[i])
print(int(amount))


minutes = input().split()
tries = input().split()
good_bad = input().split()
s = 0
for i in range(len(minutes)):
	if i == 0:
		s += max(0.3 * 500, (1 - int(minutes[0]) / 250) * 500 - 50 * int(tries[0]))
	elif i == 1:
		s += max(0.3 * 1000, (1 - int(minutes[1]) / 250) * 1000 - 50 * int(tries[1]))
	elif i == 2:
		s += max(0.3 * 1500, (1 - int(minutes[2]) / 250) * 1500 - 50 * int(tries[2]))
	elif i == 3:
		s += max(0.3 * 2000, (1 - int(minutes[3]) / 250) * 2000 - 50 * int(tries[3]))
	elif i == 4:
		s += max(0.3 * 2500, (1 - int(minutes[4]) / 250) * 2500 - 50 * int(tries[4]))
s += int(good_bad[0]) * 100
s -= int(good_bad[1]) * 50
print(int(s))


l1 = list(map(int, input().split()))
l3 = [500, 1000, 1500, 2000, 2500]
l2 = list(map(int, input().split()))
(x, y) = map(int, input().split())
score = x * 100 - y * 50
for j in range(5):
	score += max(0.3 * l3[j], (250 - l1[j]) * (l3[j] // 250) - 50 * l2[j])
print(int(score))


import fractions
X = [500, 1000, 1500, 2000, 2500]
M = list(map(int, input().split()))
W = list(map(int, input().split()))
(Hs, Hu) = map(int, input().split())
score = 100 * Hs - 50 * Hu
for (x, m, w) in zip(X, M, W):
	a = fractions.Fraction(3 * x, 10)
	b = (1 - fractions.Fraction(m, 250)) * x - 50 * w
	score += max(a, b)
print(score)


times = [int(x) for x in input().split()]
wrong = [int(x) for x in input().split()]
(goodh, badh) = [int(x) for x in input().split()]
maxpoints = [500 * i for i in range(1, 6)]
answer = 0
for i in range(5):
	answer += max(maxpoints[i] * 0.3, (1 - times[i] / 250) * maxpoints[i] - 50 * wrong[i])
answer += goodh * 100
answer -= badh * 50
print(int(answer))


a = (*map(int, input().split()),)
b = (*map(int, input().split()),)
c = (500, 1000, 1500, 2000, 2500)
(hs, hu) = map(int, input().split())
x = sum((max(0.3 * x, (1 - m / 250) * x - 50 * w) for (m, w, x) in zip(a, b, c))) + 100 * hs - 50 * hu
print(int(x))


submission_time = list(map(int, input().split()))
wrong_submission = list(map(int, input().split()))
(suc_hack, unsuc_hack) = map(int, input().split())
problem_score = [500, 1000, 1500, 2000, 2500]
score = 0
for i in range(5):
	score += max(0.3 * problem_score[i], (1 - submission_time[i] / 250) * problem_score[i] - 50 * wrong_submission[i])
score += 100 * suc_hack - 50 * unsuc_hack
print(int(score))


m = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
(hs, hu) = [int(i) for i in input().split()]
x = [500 * i for i in range(1, 6)]
ans = 0.0
for i in range(5):
	ans += max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * w[i])
ans += 100 * hs - 50 * hu
print(int(ans))


S = [500, 1000, 1500, 2000, 2500]
M = list(map(int, input().split()))
W = list(map(int, input().split()))
(H, F) = map(int, input().split())
an = 0
for i in range(5):
	x = S[i]
	m = M[i]
	w = W[i]
	an += max(0.3 * x, (1 - m / 250) * x - 50 * w)
an += H * 100 - F * 50
print(int(an))


r = lambda : list(map(int, input().split()))
arr = r()
w = r()
hacks = r()
score = 0
for i in range(5):
	tot = 500 * (i + 1)
	score += max(0.3 * tot, tot * (1 - arr[i] / 250) - 50 * w[i])
score += 100 * hacks[0]
score -= 50 * hacks[1]
print(int(score))


from fractions import Fraction
m = list(map(Fraction, input().split()))
w = list(map(Fraction, input().split()))
(h1, h2) = map(Fraction, input().split())
ball = [500, 1000, 1500, 2000, 2500]
score = Fraction(0)
for i in range(5):
	score += max(Fraction(3, 10) * ball[i], (1 - Fraction(m[i], 250)) * ball[i] - 50 * w[i])
score += h1 * 100 - 50 * h2
print(int(score))


lm = map(int, input().split())
lw = map(int, input().split())
(hs, hu) = map(int, input().split())
score = 0.0
for (m, w, x) in zip(lm, lw, [500.0, 1000.0, 1500.0, 2000.0, 2500.0]):
	score += max(0.3 * x, (1.0 - 0.004 * m) * x - 50.0 * w)
print(round(score) + 100 * hs - 50 * hu)


m = list(map(int, input().split()))
w = list(map(int, input().split()))
h = list(map(int, input().split()))
s = 0
for i in range(1, 6):
	a = 0.3 * i * 500
	b = 500 * i - 2 * i * m[i - 1] - 50 * w[i - 1]
	s += max(a, b)
s += h[0] * 100
s -= h[1] * 50
print(int(s))


Input = lambda : map(int, input().split())
m = list(Input())
w = list(Input())
h = list(Input())
x = [500, 1000, 1500, 2000, 2500]
Score = h[0] * 100 - h[1] * 50
for i in range(5):
	Score += max(0.3 * x[i], (1 - m[i] / 250) * x[i] - 50 * w[i])
print(int(Score))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
h = list(map(int, input().split()))
total = 0
for i in range(len(m)):
	x = 500 + 500 * i
	total += max(0.3 * x, (1 - m[i] / 250) * x - 50 * w[i])
total = total + 100 * h[0] - 50 * h[1]
print(int(total))


import sys

def calc(v, x, w):
	return max(v // 10 * 3, v - v // 250 * x - 50 * w)
score = [500, 1000, 1500, 2000, 2500]
m = [int(x) for x in input().split()]
w = [int(x) for x in input().split()]
(hs, hw) = map(int, input().split())
ans = 0
for i in range(5):
	ans += calc(score[i], m[i], w[i])
ans += hs * 100 - 50 * hw
print(ans)


a = []
b = []
a = list(map(int, input().split()))
b = list(map(int, input().split()))
(n, m) = map(int, input().split())
sum = 500
ans = 0
for i in range(5):
	ans += max(0.3 * sum, (1 - a[i] / 250) * sum - 50 * b[i])
	sum += 500
ans += 100 * n
ans -= 50 * m
print(int(ans))


def score(value, time, wrongAnswer):
	return max(0.3 * value, (1 - time / 250.0) * value - 50 * wrongAnswer)

def actualScore():
	times = input().split()
	times = list(map(int, times))
	wrongAnswer = input().split()
	wrongAnswer = list(map(int, wrongAnswer))
	temp = input().split()
	temp = list(map(int, temp))
	total = 0
	for problem in range(len(times)):
		total += score(500 * (problem + 1), times[problem], wrongAnswer[problem])
	total += 100 * int(temp[0])
	total -= 50 * int(temp[1])
	return int(total)
print(actualScore())


def score(m, w, x):
	return max(0.3 * x, (1 - m / 250) * x - 50 * w)
(m1, m2, m3, m4, m5) = list(map(int, input().split()))
(w1, w2, w3, w4, w5) = list(map(int, input().split()))
(hs, hu) = list(map(int, input().split()))
(x1, x2, x3, x4, x5) = (500, 1000, 1500, 2000, 2500)
print(round(score(m1, w1, x1) + score(m2, w2, x2) + score(m3, w3, x3) + score(m4, w4, x4) + score(m5, w5, x5)) + 100 * hs - 50 * hu)


N = 5
ps = [500, 1000, 1500, 2000, 2500]
(p_s, p_u) = (100, -50)
ms = list(map(int, input().split()))
ws = list(map(int, input().split()))
(h_s, h_u) = map(int, input().split())
r = 0
for i in range(N):
	r += max(0.3 * ps[i], (1 - ms[i] / 250) * ps[i] - 50 * ws[i])
r += h_s * p_s
r += h_u * p_u
print(int(r))


m = [int(x) for x in input().split()]
w = [int(x) for x in input().split()]
(sb, ub) = [int(x) for x in input().split()]
time = []
answer = 0
for i in range(5):
	answer += max(0.3 * 500 * (i + 1), (1 - m[i] / 250) * 500 * (i + 1) - 50 * w[i])
answer += 100 * sb - 50 * ub
print(int(answer))


from collections import deque, defaultdict, Counter
from itertools import product, groupby, permutations, combinations
from math import gcd, floor, inf
from bisect import bisect_right, bisect_left
max_point = [i for i in range(500, 3000, 500)]
time = map(int, input().split())
wrongs = map(int, input().split())
(suc, un) = map(int, input().split())
ans = 0
for (mx, t, w) in zip(max_point, time, wrongs):
	ans += max(0.3 * mx, (1 - t / 250) * mx - 50 * w)
ans += suc * 100
ans -= un * 50
print(int(ans))


z = [int(n) for n in input().split()]
rr = [500, 1000, 1500, 2000, 2500]
s = [int(n) for n in input().split()]
op = [int(n) for n in input().split()]
l = 0
for n in range(len(z)):
	t = 0.3 * rr[n]
	p = (1 - z[n] / 250) * rr[n] - 50 * s[n]
	l += max(t, p)
l += op[0] * 100
l -= op[1] * 50
print(int(l))


n = 5
arrtime = list(map(int, input().split()))[:n]
wrosub = list(map(int, input().split()))[:n]
(hs, hw) = map(int, input().split())
score = hs * 100 - hw * 50
arr = [500, 1000, 1500, 2000, 2500]
for i in range(0, 5):
	c = 0.3 * arr[i]
	d = (1 - arrtime[i] / 250) * arr[i] - wrosub[i] * 50
	score += max(c, d)
print(int(score))


c = [500, 1000, 1500, 2000, 2500]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
(k, l) = [int(i) for i in input().split()]
ans = 0
for i in range(5):
	ans += max(0.3 * c[i], (1 - a[i] / 250) * c[i] - 50 * b[i])
ans += 100 * k
ans -= 50 * l
print(int(ans))


import math
from decimal import *
import sys
from fractions import Fraction
M = list(map(int, input().split()))
W = list(map(int, input().split()))
H = list(map(int, input().split()))
X = [500, 1000, 1500, 2000, 2500]
ans = H[0] * 100 - H[1] * 50
for i in range(0, 5):
	ans += int(max(0.3 * X[i], (250 - M[i]) * (X[i] / 250) - 50 * W[i]))
print(ans)


t = list(map(int, input().split()))
w = list(map(int, input().split()))
(q, z) = map(int, input().split())
c = 0
v = 0
for i in range(500, 3000, 500):
	x = (1 - t[v] / 250) * i - 50 * w[v]
	a = max(0.3 * i, x)
	c = c + a
	v = v + 1
f = q * 100 - z * 50
dp = c + f
print(int(dp))


import sys
m = list(map(int, sys.stdin.readline().split()))
w = list(map(int, sys.stdin.readline().split()))
(s, u) = map(int, sys.stdin.readline().split())
score = 0
for it in range(5):
	score += max(0.3 * 500 * (it + 1), (1 - m[it] / 250) * 500 * (it + 1) - 50 * w[it])
score += 100 * s - 50 * u
print(int(score))


m = input().split()
for i in range(5):
	m[i] = int(m[i])
w = input().split()
for i in range(5):
	w[i] = int(w[i])
h = input().split()
for i in range(2):
	h[i] = int(h[i])
score = 0
for i in range(5):
	x = (i + 1) * 500
	score += max(0.3 * x, (1 - m[i] / 250) * x - 50 * w[i])
score += h[0] * 100 + h[1] * -50
print(int(score))


time = list(map(int, input().split()))
wrong = list(map(int, input().split()))
hack = list(map(int, input().split()))
points = [500, 1000, 1500, 2000, 2500]
score = 0
for i in range(5):
	score += max(0.3 * points[i], (1 - time[i] / 250) * points[i] - wrong[i] * 50)
score = score + hack[0] * 100 - hack[1] * 50
print(int(score))


tim = [0, 0, 0, 0, 0]
wrong = [0, 0, 0, 0, 0]
hacks = [0, 0]
(tim[0], tim[1], tim[2], tim[3], tim[4]) = input().split()
(wrong[0], wrong[1], wrong[2], wrong[3], wrong[4]) = input().split()
(hacks[0], hacks[1]) = input().split()
point = [500, 1000, 1500, 2000, 2500]
score = 0
for i in range(0, 5):
	point[i] = int(point[i])
	wrong[i] = int(wrong[i])
	tim[i] = int(tim[i])
	score += max(0.3 * point[i], (1 - tim[i] / 250.0) * point[i] - 50 * wrong[i])
hacks[0] = int(hacks[0])
hacks[1] = int(hacks[1])
score += 100 * hacks[0] - 50 * hacks[1]
print(int(score))


def calculate():
	m = input().split()
	w = input().split()
	(h1, h2) = input().split()
	s = []
	maxs = [500, 1000, 1500, 2000, 2500]
	for i in range(5):
		a = (1 - float(float(m[i]) / 250)) * float(maxs[i]) - 50 * float(w[i])
		s.append(max(0.3 * maxs[i], a))
	print(int(sum(s) + int(h1) * 100 - int(h2) * 50))
calculate()


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
s = 0
for i in range(5):
	t = 500 * (i + 1)
	s += max(0.3 * t, (1 - m[i] / 250) * t - 50 * w[i])
s += hs * 100 - hu * 50
print(int(s + 0.01))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(g, b) = map(int, input().split())
print(100 * g - 50 * b + max(150, 500 - 2 * m[0] - 50 * w[0]) + max(300, 1000 - 4 * m[1] - 50 * w[1]) + max(450, 1500 - 6 * m[2] - 50 * w[2]) + max(600, 2000 - 8 * m[3] - 50 * w[3]) + max(750, 2500 - 10 * m[4] - 50 * w[4]))


import sys
x1 = 500
x2 = 1000
x3 = 1500
x4 = 2000
x5 = 2500
(m1, m2, m3, m4, m5) = map(int, input().split())
(w1, w2, w3, w4, w5) = map(int, input().split())
(h1, h2) = map(int, input().split())
res1 = max(0.3 * x1, (1 - m1 / 250) * x1 - 50 * w1)
res2 = max(0.3 * x2, (1 - m2 / 250) * x2 - 50 * w2)
res3 = max(0.3 * x3, (1 - m3 / 250) * x3 - 50 * w3)
res4 = max(0.3 * x4, (1 - m4 / 250) * x4 - 50 * w4)
res5 = max(0.3 * x5, (1 - m5 / 250) * x5 - 50 * w5)
res = res1 + res2 + res3 + res4 + res5 + 100 * h1 - 50 * h2
print(int(res))


marr = [int(x) for x in input().split()]
warr = [int(x) for x in input().split()]
(hs, hu) = map(int, input().split())
score = [500, 1000, 1500, 2000, 2500]
scor = 0
for i in range(len(marr)):
	scor += max(0.3 * score[i], (1 - marr[i] / 250) * score[i] - 50 * warr[i])
scor += 100 * hs
scor -= 50 * hu
print(int(scor))


scores = [500 * i for i in range(1, 6)]
minutes = map(int, input().split())
wrongs = map(int, input().split())
(s, u) = map(int, input().split())
total_score = 0
for (minute, wrong, score) in zip(minutes, wrongs, scores):
	total_score += max(0.3 * score, (1 - minute / 250) * score - 50 * wrong)
print(int(total_score + 100 * s - 50 * u))


PROBLEMS = (500, 1000, 1500, 2000, 2500)

def problem_score(x, m, w):
	return max(75 * x, (250 - m) * x - 250 * 50 * w)

def score(ms, ws, hs, hu):
	return sum((problem_score(x, m, w) for (x, m, w) in zip(PROBLEMS, ms, ws))) // 250 + 100 * hs - 50 * hu
(m1, m2, m3, m4, m5) = map(int, input().split())
(w1, w2, w3, w4, w5) = map(int, input().split())
(hs, hu) = map(int, input().split())
print(score((m1, m2, m3, m4, m5), (w1, w2, w3, w4, w5), hs, hu))


times = [int(x) for x in input().split()]
wrong = [int(x) for x in input().split()]
hacks = [int(x) for x in input().split()]
max_scores = [500, 1000, 1500, 2000, 2500]
total = 0
for i in range(len(max_scores)):
	total += max(0.3 * max_scores[i], (1 - times[i] / 250) * max_scores[i] - 50 * wrong[i])
total += 100 * hacks[0]
total -= 50 * hacks[1]
print(int(total))


def main():
	times = input().split()
	time1 = float(times[0])
	time2 = float(times[1])
	time3 = float(times[2])
	time4 = float(times[3])
	time5 = float(times[4])
	wrongs = input().split()
	wrong1 = int(wrongs[0])
	wrong2 = int(wrongs[1])
	wrong3 = int(wrongs[2])
	wrong4 = int(wrongs[3])
	wrong5 = int(wrongs[4])
	hacks = input().split()
	hack_complete = int(hacks[0])
	hack_failed = int(hacks[1])
	sum = max(0.3 * 500, (1 - time1 / 250) * 500 - 50 * wrong1) + max(0.3 * 1000, (1 - time2 / 250) * 1000 - 50 * wrong2) + max(0.3 * 1500, (1 - time3 / 250) * 1500 - 50 * wrong3) + max(0.3 * 2000, (1 - time4 / 250) * 2000 - 50 * wrong4) + max(0.3 * 2500, (1 - time5 / 250) * 2500 - 50 * wrong5) + 100 * hack_complete - 50 * hack_failed
	print(int(sum))
main()


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(scs, fld) = map(int, input().split())
ans = 0
contest = [500, 1000, 1500, 2000, 2500]
i = 0
for problem in contest:
	ans += max(0.3 * problem, (1 - m[i] / 250) * problem - 50 * w[i])
	i += 1
print(round(ans + 100 * scs - 50 * fld))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
p = [500, 1000, 1500, 2000, 2500]
score = 0
for i in range(5):
	score += max(0.3 * p[i], (1 - m[i] / 250) * p[i] - 50 * w[i])
score += hs * 100
score -= hu * 50
print(int(score))


def main():
	m = list(map(int, input().split()))
	w = list(map(int, input().split()))
	(hs, hu) = map(int, input().split())
	score = [500, 1000, 1500, 2000, 2500]
	total = 0
	for i in range(5):
		total += max(0.3 * score[i], (1 - m[i] / 250) * score[i] - 50 * w[i])
	total += (2 * hs - hu) * 50
	print(int(total))
main()


m = input().split()
w = input().split()
(a, b) = input().split()
ans = int(a) * 100 - int(b) * 50
for i in range(5):
	x = (i + 1) * 500
	ans += max(0.3 * x, (1 - int(m[i]) / 250) * x - 50 * int(w[i]))
print(int(ans))


t = list(map(int, input().split()))
ws = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
res = 0
for (minu, wrongs, punt) in zip(t, ws, [500, 1000, 1500, 2000, 2500]):
	res += max(0.3 * punt, (1 - minu / 250) * punt - 50 * wrongs)
print(int(res + (hs * 100 + hu * -50)))


def LM():
	return list(map(int, input().split()))
M = LM()
W = LM()
result = 0
for i in range(5):
	result += max(0.3 * 500 * (i + 1), (1 - M[i] * 1 / 250) * 500 * (i + 1) - 50 * W[i])
(hs, hw) = map(int, input().split())
result += 100 * hs - 50 * hw
print(int(result))


def solve(submission_times, wrong_submissions, hacking_attempts):
	ans = 0
	points = [500, 1000, 1500, 2000, 2500]
	for (x, m, w) in zip(points, submission_times, wrong_submissions):
		ans += max(0.3 * x, (1 - m / 250) * x - 50 * w)
	ans += 100 * hacking_attempts[0]
	ans -= 50 * hacking_attempts[1]
	return int(ans)

def main():
	m = [int(c) for c in input().split()]
	w = [int(c) for c in input().split()]
	h = [int(c) for c in input().split()]
	ans = solve(m, w, h)
	print(ans)
main()


marks = [500, 1000, 1500, 2000, 2500]
time = list(map(int, input().split()))
wrong = list(map(int, input().split()))
(h, u) = map(int, input().split())
ans = 0
for i in range(5):
	ans = ans + max([0.3 * marks[i], (1 - time[i] / 250) * marks[i] - 50 * wrong[i]])
ans = ans + h * 100 - 50 * u
print(int(ans))


i = input()
j = input()
i = list(i.split(' '))
j = list(j.split(' '))
w = list(input().split(' '))
max = [500, 1000, 1500, 2000, 2500]
count = 0
ans = 0
for count in range(5):
	t = float((1 - int(i[count]) / 250) * int(max[count]) - 50 * int(j[count]))
	ans1 = 0
	ans1 = int(0.3 * int(max[count]))
	if ans1 > t:
		ans += ans1
	else:
		ans += t
ans += 100 * int(w[0]) - 50 * int(w[1])
print(int(ans))


def main():
	p = [500, 1000, 1500, 2000, 2500]
	m = list(map(int, input().strip().split()))
	w = list(map(int, input().strip().split()))
	(hs, hu) = list(map(int, input().strip().split()))
	t = 0
	for i in range(0, 5):
		t += max(int(0.3 * p[i]), 2 * (i + 1) * (250 - m[i]) - 50 * w[i])
	t += hs * 100
	t -= hu * 50
	print(t)
main()


def main():
	minutos = [int(x) for x in input().split()]
	erradas = [int(x) for x in input().split()]
	(Hs, Hf) = [int(x) for x in input().split()]
	x = [500, 1000, 1500, 2000, 2500]
	soma = sum([max(0.3 * x[i], (1 - minutos[i] / 250) * x[i] - 50 * erradas[i]) for i in range(5)])
	score = soma + Hs * 100 - Hf * 50
	print(int(score))
main()


def f(x, m, w):
	return max(0.3 * x, (1 - m / 250) * x - 50 * w)

def read_ints():
	return map(int, input().strip().split())
x = [500, 1000, 1500, 2000, 2500]
m = read_ints()
w = read_ints()
(hs, hu) = read_ints()
s = sum((f(xi, mi, wi) for (xi, mi, wi) in zip(x, m, w)))
print(round(s + 100 * hs - 50 * hu))


time = list(map(int, input().split()))
wa = list(map(int, input().split()))
hacks = list(map(int, input().split()))
points = [500, 1000, 1500, 2000, 2500]
ans = 0
for i in range(1, 6):
	a = 0.3 * points[i - 1]
	b = (1 - time[i - 1] / 250) * points[i - 1] - 50 * wa[i - 1]
	ans += max(a, b)
ans += hacks[0] * 100 - hacks[1] * 50
print(int(ans))


s = [500, 1000, 1500, 2000, 2500]
m = list(map(int, input().split()))
w = list(map(int, input().split()))
(hs, hu) = map(int, input().split())
t = 0
for x in range(5):
	t += max(0.3 * s[x], (1 - m[x] / 250) * s[x] - 50 * w[x])
print(int(t + 100 * hs - 50 * hu))


x = [500, 1000, 1500, 2000, 2500]
t = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
(a, b) = map(int, input().split())
res = 0.0
for i in range(5):
	y = (1.0 - t[i] / 250.0) * x[i] - 50 * w[i]
	res += max(0.3 * x[i], y)
res += a * 100 - b * 50
print(int(res))


point = [500, 1000, 1500, 2000, 2500]
minutes = list(map(int, input().split()))
wrong = list(map(int, input().split()))
hack = list(map(int, input().split()))
answer = 0
for (x, m, w) in zip(point, minutes, wrong):
	answer += max(0.3 * x, (1 - m / 250) * x - 50 * w)
answer += hack[0] * 100 - hack[1] * 50
print(int(answer))


m = list(map(int, input().split()))
w = list(map(int, input().split()))
h = list(map(int, input().split()))
points = [500, 1000, 1500, 2000, 2500]
ans = 0
for i in range(5):
	ans += max(0.3 * points[i], (1 - m[i] / 250) * points[i] - 50 * w[i])
ans += 100 * h[0] - 50 * h[1]
print(int(ans))