n = raw_input()
S = set(raw_input().split())

q = raw_input()
T = set(raw_input().split())

print len(S & T) n = raw_input() n raw_input() raw_input S = set(raw_input().split()) S set(raw_input().split()) set raw_input().split() ().split () raw_input split q = raw_input() q raw_input() raw_input T = set(raw_input().split()) T set(raw_input().split()) set raw_input().split() ().split () raw_input split print len(S & T) len S & T S T S = set(raw_input().split()) set(raw_input().split()) S n = raw_input() raw_input() n q = raw_input() raw_input() q T = set(raw_input().split()) set(raw_input().split()) T
n = raw_input()
S = set(raw_input().split())

q = raw_input()
T = set(raw_input().split())

print len(S & T)