import scala.io.StdIn._

object Main extends App {
  val n = readInt()
  val d = List.fill(n)(readInt())
  var maxCount = 0
  var count = 0
  var current = Int.MaxValue
  d.foreach(a => {
    if (a < current && a != 0) count += 1
    current = a
    if (count > maxCount) maxCount = count
  })

  println(maxCount)
}
