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

count = 0
for target in T:
  if target in S:
    count += 1

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

count = 0
for target in T:
  if target in S:
    count += 1

print(count)