def linearSearch(A,key):
    for i in range(len(A)):
        if A[i]==key:
            return i
        else: pass
    return -1


n=int(input())
s=list(input().split())
q=int(input())
t=input().split()

cnt=0
for i in range(q):
    x=linearSearch(s,t[i])
    if x!=(-1):
        cnt+=1
        
print(cnt)
 def linearSearch(A,key):
    for i in range(len(A)):
        if A[i]==key:
            return i
        else: pass
    return -1 linearSearch for i in range(len(A)):
        if A[i]==key:
            return i
        else: pass
     i range(len(A)) range len(A) len A if A[i]==key:
            return i
        else: pass
     A[i]==key A[i] A i key return i i return -1 -1 A A key key n=int(input()) n int(input()) int input() input s=list(input().split()) s list(input().split()) list input().split() ().split () input split q=int(input()) q int(input()) int input() input t=input().split() t input().split() ().split () input split cnt=0 cnt 0 for i in range(q):
    x=linearSearch(s,t[i])
    if x!=(-1):
        cnt+=1
         i range(q) range q x=linearSearch(s,t[i]) x linearSearch(s,t[i]) linearSearch s t[i] t i if x!=(-1):
        cnt+=1
         x!=(-1) x -1 cnt+=1 cnt 1 print(cnt) print cnt n=int(input()) int(input()) n t=input().split() input().split() t q=int(input()) int(input()) q cnt+=1 1 cnt cnt=0 0 cnt s=list(input().split()) list(input().split()) s x=linearSearch(s,t[i]) linearSearch(s,t[i]) x def linearSearch(A,key):
    for i in range(len(A)):
        if A[i]==key:
            return i
        else: pass
    return -1 def linearSearch(A,key):
    for i in range(len(A)):
        if A[i]==key:
            return i
        else: pass
    return -1 linearSearch
def linearSearch(A,key):
    for i in range(len(A)):
        if A[i]==key:
            return i
        else: pass
    return -1


n=int(input())
s=list(input().split())
q=int(input())
t=input().split()

cnt=0
for i in range(q):
    x=linearSearch(s,t[i])
    if x!=(-1):
        cnt+=1
        
print(cnt)

