N = int(input())
S = [int(x) for x in input().split()]
T = int(input())
Q = [int(x) for x in input().split()]

c = set()

for s in S:
    for q in Q:
        if s == q:
            c.add(s)

print(len(c)) N = int(input()) N 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 = [int(x) for x in input().split()] S [int(x) for x in input().split()] T = int(input()) T 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 Q = [int(x) for x in input().split()] Q [int(x) for x in input().split()] c = set() c set() set for s in S:
    for q in Q:
        if s == q:
            c.add(s) s S for q in Q:
        if s == q:
            c.add(s) q Q if s == q:
            c.add(s) s == q s q c.add(s) c.add c add s print(len(c)) print len(c) len c S = [int(x) for x in input().split()] [int(x) for x in input().split()] S Q = [int(x) for x in input().split()] [int(x) for x in input().split()] Q T = int(input()) int(input()) T c = set() set() c N = int(input()) int(input()) N
N = int(input())
S = [int(x) for x in input().split()]
T = int(input())
Q = [int(x) for x in input().split()]

c = set()

for s in S:
    for q in Q:
        if s == q:
            c.add(s)

print(len(c))
