object Main extends App{
  val n = readInt
  val p = readLine.split(" ").map(_.toInt).toList
  
  var min = p(0)
  var cnt = 0 
  p.foreach{ x => 
    if( x <= min ) { min = x; cnt += 1}
  }
  println(cnt)
}