import sys

#fin = open("test.txt", "r")
fin = sys.stdin

n = int(fin.readline())
S = list(map(int, fin.readline().split()))
q = int(fin.readline())
T = list(map(int, fin.readline().split()))

ret = 0

for t in T:
	for s in S:
		if t == s:
			ret += 1
			break

print(ret) import sys sys fin = sys.stdin fin sys.stdin sys stdin n = int(fin.readline()) n int(fin.readline()) int fin.readline() fin.readline fin readline S = list(map(int, fin.readline().split())) S list(map(int, fin.readline().split())) list map(int, fin.readline().split()) map int fin.readline().split() fin.readline().split fin.readline() fin.readline fin readline split q = int(fin.readline()) q int(fin.readline()) int fin.readline() fin.readline fin readline T = list(map(int, fin.readline().split())) T list(map(int, fin.readline().split())) list map(int, fin.readline().split()) map int fin.readline().split() fin.readline().split fin.readline() fin.readline fin readline split ret = 0 ret 0 for t in T:
	for s in S:
		if t == s:
			ret += 1
			break t T for s in S:
		if t == s:
			ret += 1
			break s S if t == s:
			ret += 1
			break t == s t s ret += 1 ret 1 break print(ret) print ret q = int(fin.readline()) int(fin.readline()) q T = list(map(int, fin.readline().split())) list(map(int, fin.readline().split())) T fin = sys.stdin sys.stdin fin S = list(map(int, fin.readline().split())) list(map(int, fin.readline().split())) S n = int(fin.readline()) int(fin.readline()) n ret += 1 1 ret ret = 0 0 ret
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

n = int(fin.readline())
S = list(map(int, fin.readline().split()))
q = int(fin.readline())
T = list(map(int, fin.readline().split()))

ret = 0

for t in T:
	for s in S:
		if t == s:
			ret += 1
			break

print(ret)