import std.stdio, std.conv, std.string, std.algorithm,
       std.math, std.array, std.container, std.typecons;

void main() {
  auto n = readln.chomp.to!int;
  auto p = readln.chomp.split.to!(int[]);
  int count=0, minimum=n+1;
  for(int i=0; i<n; i++) {
    if(p[i]<=minimum) {
      count++;
      minimum = min(minimum, p[i]);
    }
  }
  writeln(count);
}

