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

Sset = set(S)
Tset = set(T)

print(len(Sset & Tset)) n = int(input()) n int(input()) int input() input S = list(map(int, input().split())) S list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input T = list(map(int, input().split())) T list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split Sset = set(S) Sset set(S) set S Tset = set(T) Tset set(T) set T print(len(Sset & Tset)) print len(Sset & Tset) len Sset & Tset Sset Tset Sset = set(S) set(S) Sset n = int(input()) int(input()) n T = list(map(int, input().split())) list(map(int, input().split())) T S = list(map(int, input().split())) list(map(int, input().split())) S q = int(input()) int(input()) q Tset = set(T) set(T) Tset
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

Sset = set(S)
Tset = set(T)

print(len(Sset & Tset))
