N = int(input())
b = []
c = []
for j in range(N):
    a = input()
    b.append(a)
c = set(b)
print(len(c))

280cfd5cf4e6283e39fc7043b9dc3854301ecc17
<mask token>

<mask token>
for j in range(N):
    a = input()
    b.append(a)
<mask token>
print(len(c))

N = int(input())
b = []
c = []
for j in range(N):
    a = input()
    b.append(a)
c = set(b)
print(len(c))
