n=gets.to_i
numbers = gets.split.map(&:to_i)
lastNumber = numbers.max
matchCount = 0
numbers.each do |number|
  if lastNumber >= number
    matchCount += 1
    lastNumber = number
  end
end
puts matchCount