'use strict';
const main = input => {
  const n = parseInt(input[0]);
  const p = input[1].split(' ').map(val => parseInt(val));
  const mins = [];
  mins[0] = p[0];
  let ans = 1;
  for(let i=1; i<n; i++) {
    mins[i] = mins[i-1]>p[i]?p[i]:mins[i-1];
    if (mins[i] == p[i]) ans++;
  }
  console.log(ans);
  
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));