function main(input) {
    var N = input[0]-0;
    var list = input[1].split(" ").map(v=>v-0);
    var ans = 0;
    var min = Infinity;
    for(var i=0;i<N;i++){
        if(min>list[i]){
            min = list[i];
            ans++;
        }
    }
    console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
