a_N = int(input())
a_list = list(map(int, input().split()))
b_N = int(input())
b_list = list(map(int, input().split()))

answer = 0
for i in b_list:
  if i in a_list:
    answer += 1

print(answer) a_N = int(input()) a_N int(input()) int input() input a_list = list(map(int, input().split())) a_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split b_N = int(input()) b_N int(input()) int input() input b_list = list(map(int, input().split())) b_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split answer = 0 answer 0 for i in b_list:
  if i in a_list:
    answer += 1 i b_list if i in a_list:
    answer += 1 i in a_list i a_list answer += 1 answer 1 print(answer) print answer b_N = int(input()) int(input()) b_N b_list = list(map(int, input().split())) list(map(int, input().split())) b_list answer = 0 0 answer a_N = int(input()) int(input()) a_N answer += 1 1 answer a_list = list(map(int, input().split())) list(map(int, input().split())) a_list
a_N = int(input())
a_list = list(map(int, input().split()))
b_N = int(input())
b_list = list(map(int, input().split()))

answer = 0
for i in b_list:
  if i in a_list:
    answer += 1

print(answer)
