n = int(input())
S = [x for x in input().split()]
q = int(input())
T = [x for x in input().split()]
answer = {x for x in S if x in T}
print(len(answer)) n = int(input()) n int(input()) int input() input x for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() x S = [x for x in input().split()] S [x for x in input().split()] q = int(input()) q int(input()) int input() input x for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() x T = [x for x in input().split()] T [x for x in input().split()] x for x in S if x in T for x in S if x in T x S x in T x T if x in T x answer = {x for x in S if x in T} answer print(len(answer)) print len(answer) len answer q = int(input()) int(input()) q n = int(input()) int(input()) n answer = {x for x in S if x in T} answer T = [x for x in input().split()] [x for x in input().split()] T S = [x for x in input().split()] [x for x in input().split()] S
n = int(input())
S = [x for x in input().split()]
q = int(input())
T = [x for x in input().split()]
answer = {x for x in S if x in T}
print(len(answer))