N = input()
S = set(map(int, input().split()))
Q = input()
T = set(map(int, input().split()))

ans = 0
for t in T:
  if t in S:
    ans += 1
print(ans) N = input() N input() input S = set(map(int, input().split())) S set(map(int, input().split())) set map(int, input().split()) map int input().split() ().split () input split Q = input() Q input() input T = set(map(int, input().split())) T set(map(int, input().split())) set map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for t in T:
  if t in S:
    ans += 1 t T if t in S:
    ans += 1 t in S t S ans += 1 ans 1 print(ans) print ans T = set(map(int, input().split())) set(map(int, input().split())) T Q = input() input() Q ans = 0 0 ans N = input() input() N S = set(map(int, input().split())) set(map(int, input().split())) S ans += 1 1 ans
N = input()
S = set(map(int, input().split()))
Q = input()
T = set(map(int, input().split()))

ans = 0
for t in T:
  if t in S:
    ans += 1
print(ans)
