object Main extends App {
  val n = io.StdIn.readInt
  val ps = io.StdIn.readLine.split(" ").map(_.toInt)

  def rec(count: Int, list: List[Int]): Int = list match {
    case Nil => count
    case head::tail => rec(count+1, tail.filter(_ <= head))
    case head => count+1
  }

  val result = rec(0, ps.toList)
  println(result)
        
}