import std.stdio;
import std.algorithm;
import std.math;
import std.conv;
import std.string;

T readNum(T)(){
  return readStr.to!T;
}

T[] readNums(T)(){
  return readStr.split.to!(T[]);
}

string readStr(){
  return readln.chomp;
}

void main(){
	auto n = readNum!int;
	auto p = readNums!int;
	
	int nmin = p[0], ret = 1;
	for(int i = 1; i < n; i++){
		if(p[i] <= nmin){
			nmin = p[i];
			ret++;
		}
	}
	
	writeln(ret);
}