# encording: utf-8

_ = int(input())
ns = [int(e) for e in input().split()]
_ = int(input())
qs = [int(e) for e in input().split()]


def main(ns, qs):
    total = 0
    for q in qs:
        if q in ns:
            total += 1
    return total


print(main(ns, qs)) _ = int(input()) _ int(input()) int input() input int(e) for e in input().split() for e in input().split() e input().split() ().split () input split for e in input().split() int(e) int e ns = [int(e) for e in input().split()] ns [int(e) for e in input().split()] _ = int(input()) _ int(input()) int input() input int(e) for e in input().split() for e in input().split() e input().split() ().split () input split for e in input().split() int(e) int e qs = [int(e) for e in input().split()] qs [int(e) for e in input().split()] def main(ns, qs):
    total = 0
    for q in qs:
        if q in ns:
            total += 1
    return total main total = 0 total 0 for q in qs:
        if q in ns:
            total += 1
     q qs if q in ns:
            total += 1
     q in ns q ns total += 1 total 1 return total total ns ns qs qs print(main(ns, qs)) print main(ns, qs) main ns qs qs = [int(e) for e in input().split()] [int(e) for e in input().split()] qs def main(ns, qs):
    total = 0
    for q in qs:
        if q in ns:
            total += 1
    return total def main(ns, qs):
    total = 0
    for q in qs:
        if q in ns:
            total += 1
    return total main _ = int(input()) int(input()) _ _ = int(input()) int(input()) _ ns = [int(e) for e in input().split()] [int(e) for e in input().split()] ns
# encording: utf-8

_ = int(input())
ns = [int(e) for e in input().split()]
_ = int(input())
qs = [int(e) for e in input().split()]


def main(ns, qs):
    total = 0
    for q in qs:
        if q in ns:
            total += 1
    return total


print(main(ns, qs))