n=int(eval(input()))

p=[int(i) for i in input().split()]

for i in range(n):

    if i!=0:p[i]=min(p[i-1],p[i])

print((len(set(p))))

n=int(eval(input()))

p=[int(i) for i in input().split()]

for i in range(1,n):p[i]=min(p[i-1],p[i])

print((len(set(p))))

n = int(eval(input()))
p = [int(i) for i in input().split()]
for i in range(n):
    if i != 0:
        p[i] = min(p[i - 1], p[i])
print((len(set(p))))

n = int(eval(input()))
p = [int(i) for i in input().split()]
for i in range(1, n):
    p[i] = min(p[i - 1], p[i])
print((len(set(p))))

-for i in range(n): -    if i != 0: -        p[i] = min(p[i - 1], p[i]) +for i in range(1, n): +    p[i] = min(p[i - 1], p[i])