n=int(input())
S=input().split(' ')
q=int(input())
T=input().split(' ')

def equal_element(S,T):
	m=0
	for i in range(len(T)):
		for j in range(len(S)):
			if S[j]==T[i]:
				m+=1
				break
	return(m)
	
print(equal_element(S,T)) n=int(input()) n int(input()) int input() input S=input().split(' ') S input().split(' ') ().split () input split ' ' q=int(input()) q int(input()) int input() input T=input().split(' ') T input().split(' ') ().split () input split ' ' def equal_element(S,T):
	m=0
	for i in range(len(T)):
		for j in range(len(S)):
			if S[j]==T[i]:
				m+=1
				break
	return(m)
	 equal_element m=0 m 0 for i in range(len(T)):
		for j in range(len(S)):
			if S[j]==T[i]:
				m+=1
				break
	 i range(len(T)) range len(T) len T for j in range(len(S)):
			if S[j]==T[i]:
				m+=1
				break
	 j range(len(S)) range len(S) len S if S[j]==T[i]:
				m+=1
				break
	 S[j]==T[i] S[j] S j T[i] T i m+=1 m 1 break return(m) m S S T T print(equal_element(S,T)) print equal_element(S,T) equal_element S T S=input().split(' ') input().split(' ') S n=int(input()) int(input()) n T=input().split(' ') input().split(' ') T q=int(input()) int(input()) q def equal_element(S,T):
	m=0
	for i in range(len(T)):
		for j in range(len(S)):
			if S[j]==T[i]:
				m+=1
				break
	return(m)
	 def equal_element(S,T):
	m=0
	for i in range(len(T)):
		for j in range(len(S)):
			if S[j]==T[i]:
				m+=1
				break
	return(m)
	 equal_element
n=int(input())
S=input().split(' ')
q=int(input())
T=input().split(' ')

def equal_element(S,T):
	m=0
	for i in range(len(T)):
		for j in range(len(S)):
			if S[j]==T[i]:
				m+=1
				break
	return(m)
	
print(equal_element(S,T))
