def linear_search(arr, key):
	arr.append(key)
	i = 0 
	while arr[i] != key:
		i += 1
		if i == n:
			return -1 
	return i 

n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
count = 0 
for i in range(q):
	if linear_search(S, T[i]) != -1:
		count += 1
print(str(count))
 def linear_search(arr, key):
	arr.append(key)
	i = 0 
	while arr[i] != key:
		i += 1
		if i == n:
			return -1 
	return i  linear_search arr.append(key) arr.append arr append key i = 0 i 0 while arr[i] != key:
		i += 1
		if i == n:
			return -1 
	 arr[i] != key arr[i] arr i key i += 1 i 1 if i == n:
			return -1 
	 i == n i n return -1 -1 return i i arr arr key key n = int(input()) n int(input()) int input() input S = list(map(int, input().split())) S list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input T = list(map(int, input().split())) T list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split count = 0 count 0 for i in range(q):
	if linear_search(S, T[i]) != -1:
		count += 1 i range(q) range q if linear_search(S, T[i]) != -1:
		count += 1 linear_search(S, T[i]) != -1 linear_search(S, T[i]) linear_search S T[i] T i -1 count += 1 count 1 print(str(count)) print str(count) str count n = int(input()) int(input()) n count = 0 0 count count += 1 1 count S = list(map(int, input().split())) list(map(int, input().split())) S T = list(map(int, input().split())) list(map(int, input().split())) T q = int(input()) int(input()) q def linear_search(arr, key):
	arr.append(key)
	i = 0 
	while arr[i] != key:
		i += 1
		if i == n:
			return -1 
	return i  def linear_search(arr, key):
	arr.append(key)
	i = 0 
	while arr[i] != key:
		i += 1
		if i == n:
			return -1 
	return i  linear_search
def linear_search(arr, key):
	arr.append(key)
	i = 0 
	while arr[i] != key:
		i += 1
		if i == n:
			return -1 
	return i 

n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))
count = 0 
for i in range(q):
	if linear_search(S, T[i]) != -1:
		count += 1
print(str(count))

