4
1 10 7 4
15 3 8 7
250

n=input()
f=[int(i) for i in raw_input().split()]
m=[int(i) for i in raw_input().split()]
f.sort(reverse=True)
m.sort(reverse=True)
flag=0
count=0
pi=0
for i in range(0,n):
	for j in range(pi,n):
		if f[i]==m[j]:
			if ((i+1<n and j+1<n and f[i+1]>m[j+1]) or (j==n-1)):
				count+=50
				pi=j+1
				break
			if i==n-1:
				if f[i]>m[n-1]:
					count+=100
					pi=n
					break
				if f[i]==m[n-1]:
					count+=50
					pi=n
					break
		if f[i]>m[j]:
			count+=100
			pi=j+1
			break
print count