def linearSearch(S, N, key):
    i = 0
    S[N] = key
    while S[i] != key:
        i += 1
    if i != N:
        return True
    
N = int(input())
S = list(map(int,input().split()))
q = int(input())
T = list(map(int,input().split()))  

S.append(0)

sum = 0 

for j in range(q):
    if linearSearch(S,N,T[j]) == True:
        sum += 1
    
print(sum) def linearSearch(S, N, key):
    i = 0
    S[N] = key
    while S[i] != key:
        i += 1
    if i != N:
        return True
     linearSearch i = 0 i 0 S[N] = key S[N] S N key while S[i] != key:
        i += 1
     S[i] != key S[i] S i key i += 1 i 1 if i != N:
        return True
     i != N i N return True True S S N N key key 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 S.append(0) S.append S append 0 sum = 0 sum 0 for j in range(q):
    if linearSearch(S,N,T[j]) == True:
        sum += 1
     j range(q) range q if linearSearch(S,N,T[j]) == True:
        sum += 1
     linearSearch(S,N,T[j]) == True linearSearch(S,N,T[j]) linearSearch S N T[j] T j True sum += 1 sum 1 print(sum) print sum N = int(input()) int(input()) N sum += 1 1 sum S = list(map(int,input().split())) list(map(int,input().split())) S sum = 0 0 sum q = int(input()) int(input()) q def linearSearch(S, N, key):
    i = 0
    S[N] = key
    while S[i] != key:
        i += 1
    if i != N:
        return True
     def linearSearch(S, N, key):
    i = 0
    S[N] = key
    while S[i] != key:
        i += 1
    if i != N:
        return True
     linearSearch T = list(map(int,input().split())) list(map(int,input().split())) T
def linearSearch(S, N, key):
    i = 0
    S[N] = key
    while S[i] != key:
        i += 1
    if i != N:
        return True
    
N = int(input())
S = list(map(int,input().split()))
q = int(input())
T = list(map(int,input().split()))  

S.append(0)

sum = 0 

for j in range(q):
    if linearSearch(S,N,T[j]) == True:
        sum += 1
    
print(sum)
