S=[]
T=[]

S_num=int(input())
S=input().split()

T_num=int(input())
T=input().split()

cnt=0
for i in range(T_num):
	for j in range(S_num):
		if(S[j]==T[i]):
			cnt+=1
			break

print(cnt) S=[] S [] T=[] T [] S_num=int(input()) S_num int(input()) int input() input S=input().split() S input().split() ().split () input split T_num=int(input()) T_num int(input()) int input() input T=input().split() T input().split() ().split () input split cnt=0 cnt 0 for i in range(T_num):
	for j in range(S_num):
		if(S[j]==T[i]):
			cnt+=1
			break i range(T_num) range T_num for j in range(S_num):
		if(S[j]==T[i]):
			cnt+=1
			break j range(S_num) range S_num if(S[j]==T[i]):
			cnt+=1
			break S[j]==T[i] S[j] S j T[i] T i cnt+=1 cnt 1 break print(cnt) print cnt T=[] [] T S=[] [] S T=input().split() input().split() T S=input().split() input().split() S cnt+=1 1 cnt S_num=int(input()) int(input()) S_num cnt=0 0 cnt T_num=int(input()) int(input()) T_num
S=[]
T=[]

S_num=int(input())
S=input().split()

T_num=int(input())
T=input().split()

cnt=0
for i in range(T_num):
	for j in range(S_num):
		if(S[j]==T[i]):
			cnt+=1
			break

print(cnt)
