# -*- coding: utf-8 -*-
def linear_search(value, target_list):
    for key in target_list:
        if value == key:
            return True
    return False


def main():
    s_length = raw_input()
    s = raw_input().strip().split(' ')
    t_length = raw_input()
    t = raw_input().strip().split(' ')


    counter = 0
    for t_value in t:
        counter += int(linear_search(t_value, s))

    print counter

if __name__ == '__main__':
    main() def linear_search(value, target_list):
    for key in target_list:
        if value == key:
            return True
    return False linear_search for key in target_list:
        if value == key:
            return True
     key target_list if value == key:
            return True
     value == key value key return True True return False False value value target_list target_list def main():
    s_length = raw_input()
    s = raw_input().strip().split(' ')
    t_length = raw_input()
    t = raw_input().strip().split(' ')


    counter = 0
    for t_value in t:
        counter += int(linear_search(t_value, s))

    print counter main s_length = raw_input() s_length raw_input() raw_input s = raw_input().strip().split(' ') s raw_input().strip().split(' ') ().strip().split ().strip() ().strip () raw_input strip split ' ' t_length = raw_input() t_length raw_input() raw_input t = raw_input().strip().split(' ') t raw_input().strip().split(' ') ().strip().split ().strip() ().strip () raw_input strip split ' ' counter = 0 counter 0 for t_value in t:
        counter += int(linear_search(t_value, s))

     t_value t counter += int(linear_search(t_value, s)) counter int(linear_search(t_value, s)) int linear_search(t_value, s) linear_search t_value s print if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    s_length = raw_input()
    s = raw_input().strip().split(' ')
    t_length = raw_input()
    t = raw_input().strip().split(' ')


    counter = 0
    for t_value in t:
        counter += int(linear_search(t_value, s))

    print counter def main():
    s_length = raw_input()
    s = raw_input().strip().split(' ')
    t_length = raw_input()
    t = raw_input().strip().split(' ')


    counter = 0
    for t_value in t:
        counter += int(linear_search(t_value, s))

    print counter main def linear_search(value, target_list):
    for key in target_list:
        if value == key:
            return True
    return False def linear_search(value, target_list):
    for key in target_list:
        if value == key:
            return True
    return False linear_search
# -*- coding: utf-8 -*-
def linear_search(value, target_list):
    for key in target_list:
        if value == key:
            return True
    return False


def main():
    s_length = raw_input()
    s = raw_input().strip().split(' ')
    t_length = raw_input()
    t = raw_input().strip().split(' ')


    counter = 0
    for t_value in t:
        counter += int(linear_search(t_value, s))

    print counter

if __name__ == '__main__':
    main()