N = int(eval(input()))

S = [eval(input()) for i in range(N)]



S_uniqu = list(set(S))

print((len(S_uniqu)))
n, *s = open(0).read().split()

print((len(set(s))))
N = int(eval(input()))
S = [eval(input()) for i in range(N)]
S_uniqu = list(set(S))
print((len(S_uniqu)))

n, *s = open(0).read().split()
print((len(set(s))))

-N = int(eval(input())) -S = [eval(input()) for i in range(N)] -S_uniqu = list(set(S)) -print((len(S_uniqu))) +n, *s = open(0).read().split() +print((len(set(s))))