n=int(input())
s=list(map(int,input().split()))
q=int(input())
t=list(map(int,input().split()))
count=0
for i in range(q):
    for j in range(n):
         if t[i]==s[j]:
             count+=1
             break
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 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 i in range(q):
    for j in range(n):
         if t[i]==s[j]:
             count+=1
             break i range(q) range q for j in range(n):
         if t[i]==s[j]:
             count+=1
             break j range(n) range n if t[i]==s[j]:
             count+=1
             break t[i]==s[j] t[i] t i s[j] s j count+=1 count 1 break print(count) print count s=list(map(int,input().split())) list(map(int,input().split())) s count=0 0 count q=int(input()) int(input()) q n=int(input()) int(input()) n t=list(map(int,input().split())) list(map(int,input().split())) t count+=1 1 count
n=int(input())
s=list(map(int,input().split()))
q=int(input())
t=list(map(int,input().split()))
count=0
for i in range(q):
    for j in range(n):
         if t[i]==s[j]:
             count+=1
             break
print(count)
        
