N = gets.to_i
as = Array.new(N) { gets.to_i }
ans = 1
last_ans_incr = as[0]
pre = as[0]
for i in 1..(N-1)
    if as[i] > pre
        pre = as[i]
        next
    else
        if (last_ans_incr > as[i])
            last_ans_incr = as[i]
            pre = as[i]
            next
        else
            ans += 1
            pre = as[i]
            next
        end
    end
end

puts ans
