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

S = list(set(S))

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

S = list(set(S))

cnt = 0
for i in S:
    if i in T:
        cnt+=1
print(cnt)
