import scala.io.StdIn

object Main extends App {
  StdIn.readInt
  val p = StdIn.readLine.split(" ").map(_.toInt).foldLeft((0, Int.MaxValue)) {
    (a, b) => if (b < a._2) (a._1 + 1, b)
    else a
  }
  println(p._1)
}
