n = int(input())
S = [int(e) for e in input().split()]
q = int(input())
T = [int(e) for e in input().split()]

res = 0
for t in T:
    if t in S:
        res += 1

print(res)
 n = int(input()) n 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 S = [int(e) for e in input().split()] S [int(e) for e in input().split()] q = int(input()) q 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 T = [int(e) for e in input().split()] T [int(e) for e in input().split()] res = 0 res 0 for t in T:
    if t in S:
        res += 1 t T if t in S:
        res += 1 t in S t S res += 1 res 1 print(res) print res T = [int(e) for e in input().split()] [int(e) for e in input().split()] T res += 1 1 res res = 0 0 res S = [int(e) for e in input().split()] [int(e) for e in input().split()] S n = int(input()) int(input()) n q = int(input()) int(input()) q
n = int(input())
S = [int(e) for e in input().split()]
q = int(input())
T = [int(e) for e in input().split()]

res = 0
for t in T:
    if t in S:
        res += 1

print(res)

