n=int(input())
S=input().split(" ")
q=int(input())
T=input().split(" ")

count=0
for t in T:
    for s in S:
        if t==s:
            count+=1
            break

print(count)
 n=int(input()) n int(input()) int input() input S=input().split(" ") S input().split(" ") ().split () input split " " q=int(input()) q int(input()) int input() input T=input().split(" ") T input().split(" ") ().split () input split " " count=0 count 0 for t in T:
    for s in S:
        if t==s:
            count+=1
            break t T for s in S:
        if t==s:
            count+=1
            break s S if t==s:
            count+=1
            break t==s t s count+=1 count 1 break print(count) print count count+=1 1 count count=0 0 count S=input().split(" ") input().split(" ") S q=int(input()) int(input()) q n=int(input()) int(input()) n T=input().split(" ") input().split(" ") T
n=int(input())
S=input().split(" ")
q=int(input())
T=input().split(" ")

count=0
for t in T:
    for s in S:
        if t==s:
            count+=1
            break

print(count)

