# encoding: utf-8


def main():
    n = input()
    t = map(int, raw_input().split())
    q = input()
    s = map(int, raw_input().split())

    sum = 0
    for a in s:
        sum += 1 if a in t else 0

    print sum

main() def main():
    n = input()
    t = map(int, raw_input().split())
    q = input()
    s = map(int, raw_input().split())

    sum = 0
    for a in s:
        sum += 1 if a in t else 0

    print sum main n = input() n input() input t = map(int, raw_input().split()) t map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split q = input() q input() input s = map(int, raw_input().split()) s map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split sum = 0 sum 0 for a in s:
        sum += 1 if a in t else 0

     a s sum += 1 if a in t else 0 sum 1 if a in t else 0 a in t a t 1 0 print main() main def main():
    n = input()
    t = map(int, raw_input().split())
    q = input()
    s = map(int, raw_input().split())

    sum = 0
    for a in s:
        sum += 1 if a in t else 0

    print sum def main():
    n = input()
    t = map(int, raw_input().split())
    q = input()
    s = map(int, raw_input().split())

    sum = 0
    for a in s:
        sum += 1 if a in t else 0

    print sum main
# encoding: utf-8


def main():
    n = input()
    t = map(int, raw_input().split())
    q = input()
    s = map(int, raw_input().split())

    sum = 0
    for a in s:
        sum += 1 if a in t else 0

    print sum

main()