#coding:utf-8
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

def search_banpei(array, target, cnt):
    tmp = array[len(array)-1]
    array[len(array)-1] = target

    n = 0
    while array[n] != target:
        n += 1

    array[len(array)-1] = tmp
    if n < len(array) - 1 or target == tmp:
        cnt += 1
    return cnt        

def linear_search():  
    cnt = 0
    for t in T:
        for s in S:
            if t == s:
                cnt += 1
                break

def linear_banpei_search():
    cnt = 0
    for target in T:
        cnt = search_banpei(S, target, cnt)
    return cnt

cnt = linear_banpei_search()

print(cnt)
 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 def search_banpei(array, target, cnt):
    tmp = array[len(array)-1]
    array[len(array)-1] = target

    n = 0
    while array[n] != target:
        n += 1

    array[len(array)-1] = tmp
    if n < len(array) - 1 or target == tmp:
        cnt += 1
    return cnt         search_banpei tmp = array[len(array)-1] tmp array[len(array)-1] array len(array)-1 len(array) len array 1 array[len(array)-1] = target array[len(array)-1] array len(array)-1 len(array) len array 1 target n = 0 n 0 while array[n] != target:
        n += 1

     array[n] != target array[n] array n target n += 1 n 1 array[len(array)-1] = tmp array[len(array)-1] array len(array)-1 len(array) len array 1 tmp if n < len(array) - 1 or target == tmp:
        cnt += 1
     n < len(array) - 1 or target == tmp n < len(array) - 1 n len(array) - 1 len(array) len array 1 target == tmp target tmp cnt += 1 cnt 1 return cnt cnt array array target target cnt cnt def linear_search():  
    cnt = 0
    for t in T:
        for s in S:
            if t == s:
                cnt += 1
                break linear_search cnt = 0 cnt 0 for t in T:
        for s in S:
            if t == s:
                cnt += 1
                break t T for s in S:
            if t == s:
                cnt += 1
                break s S if t == s:
                cnt += 1
                break t == s t s cnt += 1 cnt 1 break def linear_banpei_search():
    cnt = 0
    for target in T:
        cnt = search_banpei(S, target, cnt)
    return cnt linear_banpei_search cnt = 0 cnt 0 for target in T:
        cnt = search_banpei(S, target, cnt)
     target T cnt = search_banpei(S, target, cnt) cnt search_banpei(S, target, cnt) search_banpei S target cnt return cnt cnt cnt = linear_banpei_search() cnt linear_banpei_search() linear_banpei_search print(cnt) print cnt T = list(map(int, input().split())) list(map(int, input().split())) T def search_banpei(array, target, cnt):
    tmp = array[len(array)-1]
    array[len(array)-1] = target

    n = 0
    while array[n] != target:
        n += 1

    array[len(array)-1] = tmp
    if n < len(array) - 1 or target == tmp:
        cnt += 1
    return cnt         def search_banpei(array, target, cnt):
    tmp = array[len(array)-1]
    array[len(array)-1] = target

    n = 0
    while array[n] != target:
        n += 1

    array[len(array)-1] = tmp
    if n < len(array) - 1 or target == tmp:
        cnt += 1
    return cnt         search_banpei q = int(input()) int(input()) q def linear_search():  
    cnt = 0
    for t in T:
        for s in S:
            if t == s:
                cnt += 1
                break def linear_search():  
    cnt = 0
    for t in T:
        for s in S:
            if t == s:
                cnt += 1
                break linear_search cnt = linear_banpei_search() linear_banpei_search() cnt S = list(map(int, input().split())) list(map(int, input().split())) S def linear_banpei_search():
    cnt = 0
    for target in T:
        cnt = search_banpei(S, target, cnt)
    return cnt def linear_banpei_search():
    cnt = 0
    for target in T:
        cnt = search_banpei(S, target, cnt)
    return cnt linear_banpei_search n = int(input()) int(input()) n
#coding:utf-8
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

def search_banpei(array, target, cnt):
    tmp = array[len(array)-1]
    array[len(array)-1] = target

    n = 0
    while array[n] != target:
        n += 1

    array[len(array)-1] = tmp
    if n < len(array) - 1 or target == tmp:
        cnt += 1
    return cnt        

def linear_search():  
    cnt = 0
    for t in T:
        for s in S:
            if t == s:
                cnt += 1
                break

def linear_banpei_search():
    cnt = 0
    for target in T:
        cnt = search_banpei(S, target, cnt)
    return cnt

cnt = linear_banpei_search()

print(cnt)

