let () = Scanf.scanf "%d\n" @@ fun n ->
  let hs = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun h -> h in
  let acc = Array.make n 0 in
  for i = n - 2 downto 0 do
    if hs.(i + 1) <= hs.(i) then
      acc.(i) <- acc.(i + 1) + 1
  done;
  Printf.printf "%d\n" @@ Array.fold_left max min_int acc
