object Main {
  def main(args: Array[String]): Unit = {
    val factor_length = io.StdIn.readInt() 
    val factors = io.StdIn.readLine.split(" ").map{_.toInt}
    var min_num = 9999999
    var count   = 0

    factors.foreach{ i =>
      if( min_num > i ) {
        count += 1
        min_num = i
      }
    }

    println( count )
  }
}