n = int(eval(input()))

s = set(int(eval(input())) for _ in range(n))

print((len(s)))

n = int(eval(input()))

print((len(set(eval(input()) for _ in range(n)))))

n = int(eval(input()))
s = set(int(eval(input())) for _ in range(n))
print((len(s)))

n = int(eval(input()))
print((len(set(eval(input()) for _ in range(n)))))

-s = set(int(eval(input())) for _ in range(n)) -print((len(s))) +print((len(set(eval(input()) for _ in range(n)))))