function main(input) {
    const args = input.split('\n');
	const  n = args[0]
	const elements = args[1].split(' ')	
	var tmp=1
    var arr=[]
    for(var i = 0;i<elements.length-1;i++){
      if(i==0)arr.push(elements[i])
        else 
      if(Math.min(...arr)>elements[i]){arr.push(elements[i])}
}

      

	console.log(arr.length)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
