"use strict"
function Main(input) {
  const args = input.trim().split('\n');
  const n = args[0];
  const p = args[1].split(' ').map(Number);

  let max = 1e10;
  let cnt = 0;

  for(let i=0; i<n; i++){
    if(p[i]<max) cnt++, max=p[i];
  }

  console.log(cnt);
}

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