n=int(eval(input()))

br=[]

for i in range(n):

  br.append(eval(input()))

m=int(eval(input()))

re=[]

for i in range(m):

  re.append(eval(input()))

point=[]

for i in br:

  bri=br.count(i)

  rei=re.count(i)

  point.append(bri-rei)

point.append(0)

print((max(point)))
n=int(eval(input()))

a={}

for _ in range(n):

  s=eval(input())

  if a.get(s):a[s]+=1

  else:a[s]=1

m=int(eval(input()))

b={}

for _ in range(m):

  s=eval(input())

  if b.get(s):b[s]+=1

  else:b[s]=1

ans=0

for i in a:

  ans=max(a[i]-b.get(i,0),ans)

print(ans)
n = int(eval(input()))
br = []
for i in range(n):
    br.append(eval(input()))
m = int(eval(input()))
re = []
for i in range(m):
    re.append(eval(input()))
point = []
for i in br:
    bri = br.count(i)
    rei = re.count(i)
    point.append(bri - rei)
point.append(0)
print((max(point)))

n = int(eval(input()))
a = {}
for _ in range(n):
    s = eval(input())
    if a.get(s):
        a[s] += 1
    else:
        a[s] = 1
m = int(eval(input()))
b = {}
for _ in range(m):
    s = eval(input())
    if b.get(s):
        b[s] += 1
    else:
        b[s] = 1
ans = 0
for i in a:
    ans = max(a[i] - b.get(i, 0), ans)
print(ans)

-br = [] -for i in range(n): -    br.append(eval(input())) +a = {} +for _ in range(n): +    s = eval(input()) +    if a.get(s): +        a[s] += 1 +    else: +        a[s] = 1 -re = [] -for i in range(m): -    re.append(eval(input())) -point = [] -for i in br: -    bri = br.count(i) -    rei = re.count(i) -    point.append(bri - rei) -point.append(0) -print((max(point))) +b = {} +for _ in range(m): +    s = eval(input()) +    if b.get(s): +        b[s] += 1 +    else: +        b[s] = 1 +ans = 0 +for i in a: +    ans = max(a[i] - b.get(i, 0), ans) +print(ans)