
if __name__ == '__main__':
    # ??????????????\???
    S_size = int(input())
    S = set([int(x) for x in input().split(' ')])
    T_size = int(input())
    T = set([int(x) for x in input().split(' ')])
    # S = [1, 2, 3, 4, 5, 1]
    # T = set([3, 4, 1])

    # ????????????
    U = S.intersection(T)

    # ???????????????
    print('{0}'.format(len(U))) if __name__ == '__main__':
    # ??????????????\???
    S_size = int(input())
    S = set([int(x) for x in input().split(' ')])
    T_size = int(input())
    T = set([int(x) for x in input().split(' ')])
    # S = [1, 2, 3, 4, 5, 1]
    # T = set([3, 4, 1])

    # ????????????
    U = S.intersection(T)

    # ???????????????
    print('{0}'.format(len(U))) __name__ == '__main__' __name__ '__main__' S_size = int(input()) S_size int(input()) int input() input int(x) for x in input().split(' ') for x in input().split(' ') x input().split(' ') ().split () input split ' ' for x in input().split(' ') int(x) int x S = set([int(x) for x in input().split(' ')]) S set([int(x) for x in input().split(' ')]) set [int(x) for x in input().split(' ')] T_size = int(input()) T_size int(input()) int input() input int(x) for x in input().split(' ') for x in input().split(' ') x input().split(' ') ().split () input split ' ' for x in input().split(' ') int(x) int x T = set([int(x) for x in input().split(' ')]) T set([int(x) for x in input().split(' ')]) set [int(x) for x in input().split(' ')] U = S.intersection(T) U S.intersection(T) S.intersection S intersection T print('{0}'.format(len(U))) print '{0}'.format(len(U)) '{0}'.format '{0}' format len(U) len U S_size = int(input()) int(input()) S_size T = set([int(x) for x in input().split(' ')]) set([int(x) for x in input().split(' ')]) T S = set([int(x) for x in input().split(' ')]) set([int(x) for x in input().split(' ')]) S U = S.intersection(T) S.intersection(T) U T_size = int(input()) int(input()) T_size

if __name__ == '__main__':
    # ??????????????\???
    S_size = int(input())
    S = set([int(x) for x in input().split(' ')])
    T_size = int(input())
    T = set([int(x) for x in input().split(' ')])
    # S = [1, 2, 3, 4, 5, 1]
    # T = set([3, 4, 1])

    # ????????????
    U = S.intersection(T)

    # ???????????????
    print('{0}'.format(len(U)))