4
1 10 7 4
15 3 8 7
250

def just_smaller(x, arr):
	ret = -1
	for i in range(len(arr)):
		if arr[i] < x:
			ret = i
	return ret

n = int(raw_input())
t1 = map(int, raw_input().split())
t2 = map(int, raw_input().split())

t1.sort()
t2.sort()

ans = 0
for i in range(n):
	r = just_smaller(t1[i], t2)
	if r != -1:
		t2 = t2[:r]+t2[r+1:]
		t1[i] = 0
		ans += 100
for i in range(n):	
	if t1[i] != 0 and t1[i] in t2:
		r = t2.index(t1[i])
		t2 = t2[:r]+t2[r+1:]
		ans += 50
print ans