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

cnt = 0

for t in T:
    if t in S:
        cnt += 1

print(cnt)
 n = int(input()) n int(input()) int input() input int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ S = [int(_) for _ in input().split()] S [int(_) for _ in input().split()] q = int(input()) q int(input()) int input() input int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ T = [int(_) for _ in input().split()] T [int(_) for _ in input().split()] cnt = 0 cnt 0 for t in T:
    if t in S:
        cnt += 1 t T if t in S:
        cnt += 1 t in S t S cnt += 1 cnt 1 print(cnt) print cnt T = [int(_) for _ in input().split()] [int(_) for _ in input().split()] T n = int(input()) int(input()) n cnt += 1 1 cnt q = int(input()) int(input()) q S = [int(_) for _ in input().split()] [int(_) for _ in input().split()] S cnt = 0 0 cnt
n = int(input())
S = [int(_) for _ in input().split()]
q = int(input())
T = [int(_) for _ in input().split()]

cnt = 0

for t in T:
    if t in S:
        cnt += 1

print(cnt)

