sn = int(input())

S=[0 for i in range(sn)]

S=input().split()

tn = int(input())

T=[0 for i in range(tn)]

T=input().split()

cnt=0

A=[]

for i in range(len(T)):
	for j in range(len(S)):
		if T[i]==S[j]:
			if T[i] not in A:
				cnt+=1
			A.append(T[i])

print(cnt) sn = int(input()) sn int(input()) int input() input 0 for i in range(sn) for i in range(sn) i range(sn) range sn for i in range(sn) 0 S=[0 for i in range(sn)] S [0 for i in range(sn)] S=input().split() S input().split() ().split () input split tn = int(input()) tn int(input()) int input() input 0 for i in range(tn) for i in range(tn) i range(tn) range tn for i in range(tn) 0 T=[0 for i in range(tn)] T [0 for i in range(tn)] T=input().split() T input().split() ().split () input split cnt=0 cnt 0 A=[] A [] for i in range(len(T)):
	for j in range(len(S)):
		if T[i]==S[j]:
			if T[i] not in A:
				cnt+=1
			A.append(T[i]) i range(len(T)) range len(T) len T for j in range(len(S)):
		if T[i]==S[j]:
			if T[i] not in A:
				cnt+=1
			A.append(T[i]) j range(len(S)) range len(S) len S if T[i]==S[j]:
			if T[i] not in A:
				cnt+=1
			A.append(T[i]) T[i]==S[j] T[i] T i S[j] S j if T[i] not in A:
				cnt+=1
			 T[i] not in A T[i] T i A cnt+=1 cnt 1 A.append(T[i]) A.append A append T[i] T i print(cnt) print cnt tn = int(input()) int(input()) tn cnt+=1 1 cnt sn = int(input()) int(input()) sn A=[] [] A S=input().split() input().split() S cnt=0 0 cnt T=input().split() input().split() T S=[0 for i in range(sn)] [0 for i in range(sn)] S T=[0 for i in range(tn)] [0 for i in range(tn)] T
sn = int(input())

S=[0 for i in range(sn)]

S=input().split()

tn = int(input())

T=[0 for i in range(tn)]

T=input().split()

cnt=0

A=[]

for i in range(len(T)):
	for j in range(len(S)):
		if T[i]==S[j]:
			if T[i] not in A:
				cnt+=1
			A.append(T[i])

print(cnt)
