object Main extends App {
  val n = scala.io.StdIn.readInt()
  val pInput = scala.io.StdIn.readLine()
  val pArray = pInput.split(" ").map(_.toInt).toVector
  var resultArray = Vector.empty[Int]
  var tempArray = pArray
  var tempResult = 0
  var maxKey = 0

  (1 to n).foreach { p =>
    if (p > maxKey) {
      maxKey = p
      var target = tempArray.head
      tempArray = tempArray.tail
      var result = 1
      tempArray.foreach { t =>
        if (t < target) {
          result = result + 1
          target = t
        }
      }
      resultArray :+= result
    }
  }
  println(resultArray.max)
}