# coding: utf-8
# Your code here!
n=int(input())
S=list(map(int,input().split()))
S1=set(S)


q=int(input())
T=list(map(int,input().split()))
count=0

for j in range(q):
    if T[j] in S1:
        count+=1
    
        
print(count) 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 S1=set(S) S1 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 count=0 count 0 for j in range(q):
    if T[j] in S1:
        count+=1
    
         j range(q) range q if T[j] in S1:
        count+=1
    
         T[j] in S1 T[j] T j S1 count+=1 count 1 print(count) print count T=list(map(int,input().split())) list(map(int,input().split())) T n=int(input()) int(input()) n count=0 0 count count+=1 1 count q=int(input()) int(input()) q S=list(map(int,input().split())) list(map(int,input().split())) S S1=set(S) set(S) S1
# coding: utf-8
# Your code here!
n=int(input())
S=list(map(int,input().split()))
S1=set(S)


q=int(input())
T=list(map(int,input().split()))
count=0

for j in range(q):
    if T[j] in S1:
        count+=1
    
        
print(count)
