# -*- coding: utf-8 -*-


def linear_search(S, T):
    count = 0
    for i in xrange(len(T)):
        if T[i] in S:
            count += 1
    return count

if __name__ == '__main__':
    n = input()
    S = map(int, raw_input().split())
    q = input()
    T = map(int, raw_input().split())

    print linear_search(S, T) def linear_search(S, T):
    count = 0
    for i in xrange(len(T)):
        if T[i] in S:
            count += 1
    return count linear_search count = 0 count 0 for i in xrange(len(T)):
        if T[i] in S:
            count += 1
     i xrange(len(T)) xrange len(T) len T if T[i] in S:
            count += 1
     T[i] in S T[i] T i S count += 1 count 1 return count count S S T T if __name__ == '__main__':
    n = input()
    S = map(int, raw_input().split())
    q = input()
    T = map(int, raw_input().split())

    print linear_search(S, T) __name__ == '__main__' __name__ '__main__' n = input() n input() input S = map(int, raw_input().split()) S map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split q = input() q input() input T = map(int, raw_input().split()) T map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split print linear_search(S, T) linear_search S T def linear_search(S, T):
    count = 0
    for i in xrange(len(T)):
        if T[i] in S:
            count += 1
    return count def linear_search(S, T):
    count = 0
    for i in xrange(len(T)):
        if T[i] in S:
            count += 1
    return count linear_search q = input() input() q T = map(int, raw_input().split()) map(int, raw_input().split()) T n = input() input() n S = map(int, raw_input().split()) map(int, raw_input().split()) S
# -*- coding: utf-8 -*-


def linear_search(S, T):
    count = 0
    for i in xrange(len(T)):
        if T[i] in S:
            count += 1
    return count

if __name__ == '__main__':
    n = input()
    S = map(int, raw_input().split())
    q = input()
    T = map(int, raw_input().split())

    print linear_search(S, T)