'use strict'

function Main(input) {

  input = input.trim().split('\n')
  const N = parseInt(input[0])
  const p = input[1].split(' ').map(s => parseInt(s))

  let count = 0
  let min = 99999
  for(let i = 0; i < N; ++i) {
    if(p[i] < min) {
      min = p[i]
      count++
    }
  }

  console.log(count)

}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));