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

C = 0
for i in range(len(S)):
    if S[i] in T:
        C += 1
print(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 S = list(set(S)) S list(set(S)) list set(S) set S 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 T = list(set(T)) T list(set(T)) list set(T) set T C = 0 C 0 for i in range(len(S)):
    if S[i] in T:
        C += 1 i range(len(S)) range len(S) len S if S[i] in T:
        C += 1 S[i] in T S[i] S i T C += 1 C 1 print(C) print C S = list(set(S)) list(set(S)) S C = 0 0 C S = list(map(int, input().split())) list(map(int, input().split())) S q = int(input()) int(input()) q C += 1 1 C n = int(input()) int(input()) n T = list(map(int, input().split())) list(map(int, input().split())) T T = list(set(T)) list(set(T)) T
n = int(input())
S = list(map(int, input().split()))
S = list(set(S))
q = int(input())
T = list(map(int, input().split()))
T = list(set(T))

C = 0
for i in range(len(S)):
    if S[i] in T:
        C += 1
print(C)
