object Main extends App{
  val n = readInt
  val p = readLine.split(" ").map(_.toInt).toList
  val ans = p.zipWithIndex.map{ case (x,idx) => 
    if( x <= p.slice(0,idx+1).min) 1 
    else 0  
  }.sum
  println(ans)
}