object Main extends App {
  import scala.io.StdIn._
  val n = readInt()
  val p = readLine().split(" ").map(_.toInt)
  var nn = p(0)
  var ans = 0
  for(i <- p){
    if(nn >= i){
      ans += 1
      nn = i
    }
  }
  println(ans)
}