n = int(input())
s = [int(x) for x in input().split()]
q = int(input())
t = [int(x) for x in input().split()]

cnt = 0

for x in t:
	if x in s:
		cnt += 1

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

cnt = 0

for x in t:
	if x in s:
		cnt += 1

print(cnt)