"use strict";

function Main(input) {
  let num = input.trim().split("\n")[0];
  let row = input.trim().split("\n")[1].split(' ').map(x => x - 0);
  let ans = 0;
  let min = Infinity;
  for(let i = 0; i < num; i++) {
    if(row[i] < min){
      ans++;
      min = row[i];
    };
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));