# coding: utf-8
class Case03

  def initialize
  end

  def show
    p self.instance_variables
        .map{ |sym| [sym, self.instance_variable_get(sym)] }
        .to_h
  end
  
  # 実行する
  def execute
    read
    solve
    output
  end

  # 読込
  def read
    @n = gets.chomp.to_i
    @h = gets.chomp.split.map(&:to_i)
  end

  # 回答
  def solve
    e = @n
    s = @n
    @result = 0
    while e >= 1 do
      while s > 1 && @h[s-2] >= @h[s-1] do
        s -= 1
      end
      @result = (e - s) if (e - s) > @result
      break if s <= 1
      e = s - 1
      s = e
    end
  end
  
  # 出力
  def output
    puts @result
  end

end

Case03.new.execute if $0 == __FILE__

