"use strict";
main(require("fs").readFileSync("/dev/stdin", "UTF-8"));

function main(input) {
  input = input.split("\n");
  const N = input.shift();
  const permutation = input[0].split(" ");

  let result = 0;
  let min = permutation[0];

  for (let i = 0; i < N; i++) {
    if (min >= permutation[i]) {
      result++;
      min = permutation[i];
    }
  }
  console.log(result);
}
