4
1 10 7 4
15 3 8 7
250

n = input()
a = [int(i) for i in raw_input().split()]
b = [int(i) for i in raw_input().split()]
a.sort()
b.sort(reverse=True)
sc = 0
while(1):
    ac=False
    for i in xrange(n):
        for j in xrange(n):
            if(a[i]>b[j]):
                del a[i]
                del b[j]
                sc+=100
                n-=1
                ac=True
            if(ac==True):
                break
        if(ac==True):
            break
    if(ac==False):
        break
while(1):
    ac=False
    for i in xrange(n):
        for j in xrange(n):
            if(a[i]==b[j]):
                del a[i]
                del b[j]
                sc+=50
                n-=1
                ac=True
            if(ac==True):
                break
        if(ac==True):
            break
    if(ac==False):
        break
print sc