'use strict';
function main(input) {
  var P = input.split('\n')[1].split(' ');
  var min = 2 * Math.pow(10, 5) + 1;
  var cnt = 0;
  for (var p of P) {
    p = parseInt(p);
    if (p < min) {
      ++cnt;
      min = p;
    }
  }
  console.log(cnt);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));