import java.io.{BufferedReader, InputStreamReader}

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val n = in.readLine().toInt
    val ps = in.readLine().split("\\s+").map(_.toInt)

    var min = Integer.MAX_VALUE
    var count = 0

    ps.foreach { p =>
      if ( min > p ) {
        count += 1
        min = p
      }
    }

    System.out.println(
      count
    )
  }
}
