n = input()
S = set(input().split())
S.discard(' ')

q = input()
T = set(input().split())
T.discard(' ')


U = S.intersection(T)

print(len(U)) n = input() n input() input S = set(input().split()) S set(input().split()) set input().split() ().split () input split S.discard(' ') S.discard S discard ' ' q = input() q input() input T = set(input().split()) T set(input().split()) set input().split() ().split () input split T.discard(' ') T.discard T discard ' ' U = S.intersection(T) U S.intersection(T) S.intersection S intersection T print(len(U)) print len(U) len U U = S.intersection(T) S.intersection(T) U T = set(input().split()) set(input().split()) T S = set(input().split()) set(input().split()) S q = input() input() q n = input() input() n
n = input()
S = set(input().split())
S.discard(' ')

q = input()
T = set(input().split())
T.discard(' ')


U = S.intersection(T)

print(len(U))