eval(input());a=list(map(int,input().split()));d={}

for i in a:

  if i not in d: d[i]=1

  else: d[i]+=1

print((sum([j if i>j else j-i for i,j in list(d.items())])))
from collections import Counter

eval(input());a=Counter(list(map(int,input().split())))

print((sum(j if i>j else j-i for i,j in list(a.items()))))
eval(input())
a = list(map(int, input().split()))
d = {}
for i in a:
    if i not in d:
        d[i] = 1
    else:
        d[i] += 1
print((sum([j if i > j else j - i for i, j in list(d.items())])))

from collections import Counter

eval(input())
a = Counter(list(map(int, input().split())))
print((sum(j if i > j else j - i for i, j in list(a.items()))))

+from collections import Counter + -a = list(map(int, input().split())) -d = {} -for i in a: -    if i not in d: -        d[i] = 1 -    else: -        d[i] += 1 -print((sum([j if i > j else j - i for i, j in list(d.items())]))) +a = Counter(list(map(int, input().split()))) +print((sum(j if i > j else j - i for i, j in list(a.items()))))