# your code goes here
#linear
n=int(input())
S=[int(i) for i in input().split()]
q=int(input())
T=[int(i) for i in input().split()]
c=0
for i in range(q):
    j=0
    while j<n and T[i]!=S[j]:
        j+=1
    if j<n:
        c+=1
print(c) n=int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i S=[int(i) for i in input().split()] S [int(i) for i in input().split()] q=int(input()) q int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i T=[int(i) for i in input().split()] T [int(i) for i in input().split()] c=0 c 0 for i in range(q):
    j=0
    while j<n and T[i]!=S[j]:
        j+=1
    if j<n:
        c+=1 i range(q) range q j=0 j 0 while j<n and T[i]!=S[j]:
        j+=1
     j<n and T[i]!=S[j] j<n j n T[i]!=S[j] T[i] T i S[j] S j j+=1 j 1 if j<n:
        c+=1 j<n j n c+=1 c 1 print(c) print c T=[int(i) for i in input().split()] [int(i) for i in input().split()] T j=0 0 j q=int(input()) int(input()) q c=0 0 c c+=1 1 c n=int(input()) int(input()) n S=[int(i) for i in input().split()] [int(i) for i in input().split()] S j+=1 1 j
# your code goes here
#linear
n=int(input())
S=[int(i) for i in input().split()]
q=int(input())
T=[int(i) for i in input().split()]
c=0
for i in range(q):
    j=0
    while j<n and T[i]!=S[j]:
        j+=1
    if j<n:
        c+=1
print(c)