n = int(eval(input()))

d = {}

for i in range(n):

    s = eval(input())

    try:d[s]+=1

    except:d[s]=1

print((len(d)))
n = int(eval(input()))

print((len(set([eval(input()) for i in range(n)]))))

n = int(eval(input()))
d = {}
for i in range(n):
    s = eval(input())
    try:
        d[s] += 1
    except:
        d[s] = 1
print((len(d)))

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

-d = {} -for i in range(n): -    s = eval(input()) -    try: -        d[s] += 1 -    except: -        d[s] = 1 -print((len(d))) +print((len(set([eval(input()) for i in range(n)]))))