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

C = []
for s in S:
  for t in T:
    if s == t and not s in C: C.append(s)
print(len(C)) 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 C = [] C [] for s in S:
  for t in T:
    if s == t and not s in C: C.append(s) s S for t in T:
    if s == t and not s in C: C.append(s) t T if s == t and not s in C: C.appen s == t and not s in C s == t s t not s in C s in C s C print(len(C)) print len(C) len C S = list(map(int, input().split())) list(map(int, input().split())) S C = [] [] C q = int(input()) int(input()) q n = int(input()) int(input()) n T = list(map(int, input().split())) list(map(int, input().split())) T
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

C = []
for s in S:
  for t in T:
    if s == t and not s in C: C.append(s)
print(len(C))