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


def main():
    s_length = int(raw_input())
    s = [int(x) for x in raw_input().strip().split(' ')]
    t_length = int(raw_input())
    t = [int(x) for x in raw_input().strip().split(' ')]

    counter = 0
    for value in t:
        if value in s:
            counter += 1

    print counter 

if __name__ == '__main__':
    main() def main():
    s_length = int(raw_input())
    s = [int(x) for x in raw_input().strip().split(' ')]
    t_length = int(raw_input())
    t = [int(x) for x in raw_input().strip().split(' ')]

    counter = 0
    for value in t:
        if value in s:
            counter += 1

    print counter  main s_length = int(raw_input()) s_length int(raw_input()) int raw_input() raw_input int(x) for x in raw_input().strip().split(' ') for x in raw_input().strip().split(' ') x raw_input().strip().split(' ') ().strip().split ().strip() ().strip () raw_input strip split ' ' for x in raw_input().strip().split(' ') int(x) int x s = [int(x) for x in raw_input().strip().split(' ')] s [int(x) for x in raw_input().strip().split(' ')] t_length = int(raw_input()) t_length int(raw_input()) int raw_input() raw_input int(x) for x in raw_input().strip().split(' ') for x in raw_input().strip().split(' ') x raw_input().strip().split(' ') ().strip().split ().strip() ().strip () raw_input strip split ' ' for x in raw_input().strip().split(' ') int(x) int x t = [int(x) for x in raw_input().strip().split(' ')] t [int(x) for x in raw_input().strip().split(' ')] counter = 0 counter 0 for value in t:
        if value in s:
            counter += 1

     value t if value in s:
            counter += 1

     value in s value s counter += 1 counter 1 print if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    s_length = int(raw_input())
    s = [int(x) for x in raw_input().strip().split(' ')]
    t_length = int(raw_input())
    t = [int(x) for x in raw_input().strip().split(' ')]

    counter = 0
    for value in t:
        if value in s:
            counter += 1

    print counter  def main():
    s_length = int(raw_input())
    s = [int(x) for x in raw_input().strip().split(' ')]
    t_length = int(raw_input())
    t = [int(x) for x in raw_input().strip().split(' ')]

    counter = 0
    for value in t:
        if value in s:
            counter += 1

    print counter  main
# -*- coding: utf-8 -*-


def main():
    s_length = int(raw_input())
    s = [int(x) for x in raw_input().strip().split(' ')]
    t_length = int(raw_input())
    t = [int(x) for x in raw_input().strip().split(' ')]

    counter = 0
    for value in t:
        if value in s:
            counter += 1

    print counter 

if __name__ == '__main__':
    main()