
def LinearSearch(n, S, t):
    """ ????????????????????¢????????? """
    S.append(t)
    i = 0

    while S[i] != t:
        i += 1

    if i == n:
        return -1
    else:
        return i

n = int(input())
S = [int(s) for s in input().split()]

q = int(input())
T = [int(t) for t in input().split()]

cnt = 0

for t in T:
    if LinearSearch(n, S[:], t) != -1:
        cnt += 1

print(cnt) def LinearSearch(n, S, t):
    """ ????????????????????¢????????? """
    S.append(t)
    i = 0

    while S[i] != t:
        i += 1

    if i == n:
        return -1
    else:
        return i LinearSearch """ ????????????????????¢????????? """ S.append(t) S.append S append t i = 0 i 0 while S[i] != t:
        i += 1

     S[i] != t S[i] S i t i += 1 i 1 if i == n:
        return -1
    else:
        return i i == n i n return -1 -1 return i i n n S S t t n = int(input()) n int(input()) int input() input int(s) for s in input().split() for s in input().split() s input().split() ().split () input split for s in input().split() int(s) int s S = [int(s) for s in input().split()] S [int(s) for s in input().split()] q = int(input()) q int(input()) int input() input int(t) for t in input().split() for t in input().split() t input().split() ().split () input split for t in input().split() int(t) int t T = [int(t) for t in input().split()] T [int(t) for t in input().split()] cnt = 0 cnt 0 for t in T:
    if LinearSearch(n, S[:], t) != -1:
        cnt += 1 t T if LinearSearch(n, S[:], t) != -1:
        cnt += 1 LinearSearch(n, S[:], t) != -1 LinearSearch(n, S[:], t) LinearSearch n S[:] S : t -1 cnt += 1 cnt 1 print(cnt) print cnt T = [int(t) for t in input().split()] [int(t) for t in input().split()] T n = int(input()) int(input()) n cnt = 0 0 cnt cnt += 1 1 cnt def LinearSearch(n, S, t):
    """ ????????????????????¢????????? """
    S.append(t)
    i = 0

    while S[i] != t:
        i += 1

    if i == n:
        return -1
    else:
        return i def LinearSearch(n, S, t):
    """ ????????????????????¢????????? """
    S.append(t)
    i = 0

    while S[i] != t:
        i += 1

    if i == n:
        return -1
    else:
        return i LinearSearch S = [int(s) for s in input().split()] [int(s) for s in input().split()] S q = int(input()) int(input()) q

def LinearSearch(n, S, t):
    """ ????????????????????¢????????? """
    S.append(t)
    i = 0

    while S[i] != t:
        i += 1

    if i == n:
        return -1
    else:
        return i

n = int(input())
S = [int(s) for s in input().split()]

q = int(input())
T = [int(t) for t in input().split()]

cnt = 0

for t in T:
    if LinearSearch(n, S[:], t) != -1:
        cnt += 1

print(cnt)