#coding: Shift_JIS

def set_array(a,n):
	str=input()
	array=str.split()
	for i in range(n):
		a.append(int(array[i]))
	

n=int(input())
S=[]
set_array(S,n)
q=int(input())
T=[]
set_array(T,q)
C=0

def linear_search(S,x):
	S.append(x)
	l=len(S)
	i=0
	while(l>i):
		if S[i]==x:
			break
		i=i+1
	S.pop(-1)
	if i!=l-1:
		return 1;
	else:
		return 0;
for v in T:
	C+=linear_search(S,v)

print(C) def set_array(a,n):
	str=input()
	array=str.split()
	for i in range(n):
		a.append(int(array[i]))
	 set_array str=input() str input() input array=str.split() array str.split() str.split str split for i in range(n):
		a.append(int(array[i]))
	 i range(n) range n a.append(int(array[i])) a.append a append int(array[i]) int array[i] array i a a n n n=int(input()) n int(input()) int input() input S=[] S [] set_array(S,n) set_array S n q=int(input()) q int(input()) int input() input T=[] T [] set_array(T,q) set_array T q C=0 C 0 def linear_search(S,x):
	S.append(x)
	l=len(S)
	i=0
	while(l>i):
		if S[i]==x:
			break
		i=i+1
	S.pop(-1)
	if i!=l-1:
		return 1;
	else:
		return 0; linear_search S.append(x) S.append S append x l=len(S) l len(S) len S i=0 i 0 while(l>i):
		if S[i]==x:
			break
		i=i+1
	 l>i l i if S[i]==x:
			break
		 S[i]==x S[i] S i x break i=i+1 i i+1 i 1 S.pop(-1) S.pop S pop -1 if i!=l-1:
		return 1;
	else:
		return 0; i!=l-1 i l-1 l 1 return 1 1 return 0 0 S S x x for v in T:
	C+=linear_search(S,v) v T C+=linear_search(S,v) C linear_search(S,v) linear_search S v print(C) print C S=[] [] S T=[] [] T def linear_search(S,x):
	S.append(x)
	l=len(S)
	i=0
	while(l>i):
		if S[i]==x:
			break
		i=i+1
	S.pop(-1)
	if i!=l-1:
		return 1;
	else:
		return 0; def linear_search(S,x):
	S.append(x)
	l=len(S)
	i=0
	while(l>i):
		if S[i]==x:
			break
		i=i+1
	S.pop(-1)
	if i!=l-1:
		return 1;
	else:
		return 0; linear_search C+=linear_search(S,v) linear_search(S,v) C def set_array(a,n):
	str=input()
	array=str.split()
	for i in range(n):
		a.append(int(array[i]))
	 def set_array(a,n):
	str=input()
	array=str.split()
	for i in range(n):
		a.append(int(array[i]))
	 set_array n=int(input()) int(input()) n C=0 0 C q=int(input()) int(input()) q
#coding: Shift_JIS

def set_array(a,n):
	str=input()
	array=str.split()
	for i in range(n):
		a.append(int(array[i]))
	

n=int(input())
S=[]
set_array(S,n)
q=int(input())
T=[]
set_array(T,q)
C=0

def linear_search(S,x):
	S.append(x)
	l=len(S)
	i=0
	while(l>i):
		if S[i]==x:
			break
		i=i+1
	S.pop(-1)
	if i!=l-1:
		return 1;
	else:
		return 0;
for v in T:
	C+=linear_search(S,v)

print(C)
