4
1 10 7 4
15 3 8 7
250

#Max score between football players

FinanceTeamSkill = []
MarketingTeamSkill = []

def MaxScore():
	temp = 0
	total = 0
	for fp_skill in range(0, len(FinanceTeamSkill)+1):
		if(temp >= len(MarketingTeamSkill) or fp_skill >= len(FinanceTeamSkill)):
			break
		while FinanceTeamSkill[fp_skill] <= MarketingTeamSkill[temp]:
			temp += 1
			if(temp >= len(MarketingTeamSkill)):
				break
		while FinanceTeamSkill[fp_skill] >= MarketingTeamSkill[temp] and fp_skill < len(FinanceTeamSkill):
			if(FinanceTeamSkill[fp_skill] == MarketingTeamSkill[temp]):
				FinanceTeamSkill.pop(fp_skill)
				MarketingTeamSkill.pop(temp)
				total += 50
			elif (FinanceTeamSkill[fp_skill] > MarketingTeamSkill[temp]):
				FinanceTeamSkill.pop(fp_skill)
				MarketingTeamSkill.pop(temp)
				total += 100
			else:
				temp += 1
			if(temp >= len(MarketingTeamSkill) or fp_skill >= len(FinanceTeamSkill)):
				break
		if(fp_skill >= len(FinanceTeamSkill)):
				break
		fp_skill -= 1
	return total	

no_of_players = int(raw_input())

if(no_of_players < 1 or no_of_players > 20):
	exit

temp = raw_input().split()
FinanceTeamSkill = [int(i) for i in temp]
temp = raw_input().split()
MarketingTeamSkill = [int(i) for i in temp]

FinanceTeamSkill.sort(reverse = True)
MarketingTeamSkill.sort(reverse = True)
print MaxScore()