input()
s = set(n for n in input().split())
input()
t = set(n for n in input().split())
print(len(s & t)) input() input s = set(n for n in input().split()) s set(n for n in input().split()) set n input() input t = set(n for n in input().split()) t set(n for n in input().split()) set n print(len(s & t)) print len(s & t) len s & t s t s = set(n for n in input().split()) set(n for n in input().split()) s t = set(n for n in input().split()) set(n for n in input().split()) t
input()
s = set(n for n in input().split())
input()
t = set(n for n in input().split())
print(len(s & t))