def linearSearch(A, n, key):
	i = 0
	A.append(key)
	while (A[i] != key):
		i += 1
	del A[n]

	return i != n


if __name__ == '__main__':
	
	n = int(input())
	L = list(map(int, input().split()))

	q = int(input())
	Key = list(map(int, input().split()))

	cnt = 0
	for i in range(q):
		if (linearSearch(L, n, Key[i])):
			cnt += 1

	print(cnt) def linearSearch(A, n, key):
	i = 0
	A.append(key)
	while (A[i] != key):
		i += 1
	del A[n]

	return i != n linearSearch i = 0 i 0 A.append(key) A.append A append key while (A[i] != key):
		i += 1
	 A[i] != key A[i] A i key i += 1 i 1 del A[n] A[n] A n return i != n i != n i n A A n n key key if __name__ == '__main__':
	
	n = int(input())
	L = list(map(int, input().split()))

	q = int(input())
	Key = list(map(int, input().split()))

	cnt = 0
	for i in range(q):
		if (linearSearch(L, n, Key[i])):
			cnt += 1

	print(cnt) __name__ == '__main__' __name__ '__main__' n = int(input()) n int(input()) int input() input L = list(map(int, input().split())) L 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 Key = list(map(int, input().split())) Key list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 for i in range(q):
		if (linearSearch(L, n, Key[i])):
			cnt += 1

	 i range(q) range q if (linearSearch(L, n, Key[i])):
			cnt += 1

	 linearSearch(L, n, Key[i]) linearSearch L n Key[i] Key i cnt += 1 cnt 1 print(cnt) print cnt L = list(map(int, input().split())) list(map(int, input().split())) L def linearSearch(A, n, key):
	i = 0
	A.append(key)
	while (A[i] != key):
		i += 1
	del A[n]

	return i != n def linearSearch(A, n, key):
	i = 0
	A.append(key)
	while (A[i] != key):
		i += 1
	del A[n]

	return i != n linearSearch cnt = 0 0 cnt q = int(input()) int(input()) q n = int(input()) int(input()) n cnt += 1 1 cnt Key = list(map(int, input().split())) list(map(int, input().split())) Key
def linearSearch(A, n, key):
	i = 0
	A.append(key)
	while (A[i] != key):
		i += 1
	del A[n]

	return i != n


if __name__ == '__main__':
	
	n = int(input())
	L = list(map(int, input().split()))

	q = int(input())
	Key = list(map(int, input().split()))

	cnt = 0
	for i in range(q):
		if (linearSearch(L, n, Key[i])):
			cnt += 1

	print(cnt)
