a_len = int(input())
a = {n for n in input().split(" ")}
b_len = int(input())
b = {n for n in input().split(" ")}
print(len(a & b)) a_len = int(input()) a_len int(input()) int input() input n for n in input().split(" ") for n in input().split(" ") n input().split(" ") ().split () input split " " for n in input().split(" ") n a = {n for n in input().split(" ")} a b_len = int(input()) b_len int(input()) int input() input n for n in input().split(" ") for n in input().split(" ") n input().split(" ") ().split () input split " " for n in input().split(" ") n b = {n for n in input().split(" ")} b print(len(a & b)) print len(a & b) len a & b a b a_len = int(input()) int(input()) a_len b_len = int(input()) int(input()) b_len a = {n for n in input().split(" ")} a b = {n for n in input().split(" ")} b
a_len = int(input())
a = {n for n in input().split(" ")}
b_len = int(input())
b = {n for n in input().split(" ")}
print(len(a & b))