fun main(args: Array<String>) {
  readLine()
  val p = readLine()!!.split(" ").map(String::toLong)
  var m: Long = p[0]
  var a: Long = 0
  for (i in p) {
    m = Math.min(m, i)
    if (m >= i) {
      a += 1
    }
  }
  println(a)
}
