function main(input) {
    const args = input.split('\n');
	const  n = args[0]
	const elements = args[1].split(' ')	
	var tmp=1
    var arr=[]
	elements.forEach((el,index)=>{
  	  if(index==0)arr.push(el)
      else 
        if(arr[arr.length-1]>el){arr.push(el)}
    arr.sort((a,b)=>b-a)      
    })
	console.log(arr.length)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
