N = int(eval(input()))

P = list(map(int, input().split()))



count = 1

d = P[0]

for i in range(N - 1):

    if (d > P[i + 1]):

        d = min(P[i], P[i + 1])

        count += 1



print(count)

from collections import deque

N = int(eval(input()))

P = list(map(int, input().split()))



d = deque(P)

count = 1



for i in range(1, N):

    if (d[0] >= d[1]):

        d.popleft()

        count += 1

    else:

        d1 = d.popleft()

        d2 = d.popleft()

        d.appendleft(d1)



print(count)
N = int(eval(input()))
P = list(map(int, input().split()))
count = 1
d = P[0]
for i in range(N - 1):
    if d > P[i + 1]:
        d = min(P[i], P[i + 1])
        count += 1
print(count)

from collections import deque

N = int(eval(input()))
P = list(map(int, input().split()))
d = deque(P)
count = 1
for i in range(1, N):
    if d[0] >= d[1]:
        d.popleft()
        count += 1
    else:
        d1 = d.popleft()
        d2 = d.popleft()
        d.appendleft(d1)
print(count)

+from collections import deque + +d = deque(P) -d = P[0] -for i in range(N - 1): -    if d > P[i + 1]: -        d = min(P[i], P[i + 1]) +for i in range(1, N): +    if d[0] >= d[1]: +        d.popleft() +    else: +        d1 = d.popleft() +        d2 = d.popleft() +        d.appendleft(d1)