n = int(eval(input()))



s_list = []

for i in range(n):

    s = str(eval(input()))

    s_list.append(s)

    

print((len(set(s_list))))    
n = int(eval(input()))

list =[eval(input()) for _ in range(n)]

print((len(set(list))))
n = int(eval(input()))
s_list = []
for i in range(n):
    s = str(eval(input()))
    s_list.append(s)
print((len(set(s_list))))

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

-s_list = [] -for i in range(n): -    s = str(eval(input())) -    s_list.append(s) -print((len(set(s_list)))) +list = [eval(input()) for _ in range(n)] +print((len(set(list))))