# import sys

n = int(raw_input())
S = map(int, raw_input().strip(" ").split(" "))
q = int(raw_input())
T = map(int, raw_input().strip(" ").split(" "))

count = 0
for j in T:
	for n in S:
		if n == j:
			count += 1
			break

print count  n = int(raw_input()) n int(raw_input()) int raw_input() raw_input S = map(int, raw_input().strip(" ").split(" ")) S map(int, raw_input().strip(" ").split(" ")) map int raw_input().strip(" ").split(" ") ().strip(" ").split ().strip(" ") ().strip () raw_input strip " " split " " q = int(raw_input()) q int(raw_input()) int raw_input() raw_input T = map(int, raw_input().strip(" ").split(" ")) T map(int, raw_input().strip(" ").split(" ")) map int raw_input().strip(" ").split(" ") ().strip(" ").split ().strip(" ") ().strip () raw_input strip " " split " " count = 0 count 0 for j in T:
	for n in S:
		if n == j:
			count += 1
			break j T for n in S:
		if n == j:
			count += 1
			break n S if n == j:
			count += 1
			break n == j n j count += 1 count 1 break print count = 0 0 count n = int(raw_input()) int(raw_input()) n q = int(raw_input()) int(raw_input()) q count += 1 1 count S = map(int, raw_input().strip(" ").split(" ")) map(int, raw_input().strip(" ").split(" ")) S T = map(int, raw_input().strip(" ").split(" ")) map(int, raw_input().strip(" ").split(" ")) T
# import sys

n = int(raw_input())
S = map(int, raw_input().strip(" ").split(" "))
q = int(raw_input())
T = map(int, raw_input().strip(" ").split(" "))

count = 0
for j in T:
	for n in S:
		if n == j:
			count += 1
			break

print count 