N = gets.chomp.to_i
arr = readlines.map{|n| n.chomp.to_i}
color = []
# p N,arr

# color = {}
c_i = 1
max_num = nil
min_num = nil

arr.each do |n|
    if max_num.nil?
        max_num = n
        min_num = n
        next
    end
    if max_num < n
        max_num = n
    elsif n <= min_num 
        min_num = n
        c_i+=1
    end
end

puts c_i