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

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

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

  def enum_min(min: Int, list: List[Int], acc: List[Int]): List[Int] = list match {
    case Nil => acc
    // case head::Nil  => enum_min(math.min(min,head), tail, acc:+math.min(min,head))
    case head::tail => enum_min(math.min(min,head), tail, acc:+math.min(min,head))
  }
  val minPs = enum_min(ps.head, ps.toList, Nil)

  val result = (minPs.toArray zip ps).count { case (min, p) => min == p }
  println(result)
}