def linearSearch(S,t):
    L = S + [t]
    i = 0
    while L[i] != t: i += 1
    if i == len(L)-1: return 0
    else            : return 1

if __name__=='__main__':
    n=int(input()) 
    S=list(map(int,input().split()))
    q=int(input()) 
    T=list(map(int,input().split()))
    cnt = 0
    for t in T: cnt += linearSearch(S,t)
    print(cnt) def linearSearch(S,t):
    L = S + [t]
    i = 0
    while L[i] != t: i += 1
    if i == len(L)-1: return 0
    else            : return 1 linearSearch L = S + [t] L S + [t] S [t] t i = 0 i 0 while L[i] != t: i += 1
     L[i] != t L[i] L i t if i == len(L)-1: return 0
    else            : return 1 i == len(L)-1 i len(L)-1 len(L) len L 1 S S t t if __name__=='__main__':
    n=int(input()) 
    S=list(map(int,input().split()))
    q=int(input()) 
    T=list(map(int,input().split()))
    cnt = 0
    for t in T: cnt += linearSearch(S,t)
    print(cnt) __name__=='__main__' __name__ '__main__' 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 cnt = 0 cnt 0 for t in T: cnt += linearSearch(S,t)
     t T print(cnt) print cnt cnt = 0 0 cnt S=list(map(int,input().split())) list(map(int,input().split())) S def linearSearch(S,t):
    L = S + [t]
    i = 0
    while L[i] != t: i += 1
    if i == len(L)-1: return 0
    else            : return 1 def linearSearch(S,t):
    L = S + [t]
    i = 0
    while L[i] != t: i += 1
    if i == len(L)-1: return 0
    else            : return 1 linearSearch n=int(input()) int(input()) n T=list(map(int,input().split())) list(map(int,input().split())) T q=int(input()) int(input()) q
def linearSearch(S,t):
    L = S + [t]
    i = 0
    while L[i] != t: i += 1
    if i == len(L)-1: return 0
    else            : return 1

if __name__=='__main__':
    n=int(input()) 
    S=list(map(int,input().split()))
    q=int(input()) 
    T=list(map(int,input().split()))
    cnt = 0
    for t in T: cnt += linearSearch(S,t)
    print(cnt)