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)
  */        

  /* TLE case
  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)
  */

  val result = enum_min(ps.head, ps.toList, 0)
  def enum_min(min: Int, list: List[Int], count: Int): Int = list match {
    case Nil => count
    case head::tail if head <= min => enum_min(head, tail, count+1)
    case head::tail if min < head  => enum_min(min, tail, count)
  }
  
  println(result)
}