# ALDS1 : Linear Search

n = input()
S = set(map(int,raw_input().split()))
q = input()
T = set(map(int,raw_input().split()))

print len(S & T) n = input() n input() input S = set(map(int,raw_input().split())) S set(map(int,raw_input().split())) set map(int,raw_input().split()) map int raw_input().split() ().split () raw_input split q = input() q input() input T = set(map(int,raw_input().split())) T set(map(int,raw_input().split())) set map(int,raw_input().split()) map int raw_input().split() ().split () raw_input split print len(S & T) len S & T S T n = input() input() n S = set(map(int,raw_input().split())) set(map(int,raw_input().split())) S q = input() input() q T = set(map(int,raw_input().split())) set(map(int,raw_input().split())) T
# ALDS1 : Linear Search

n = input()
S = set(map(int,raw_input().split()))
q = input()
T = set(map(int,raw_input().split()))

print len(S & T)