function Main(input) {
    input = input.split("\n");
    tmp = input[1].split(" ");
    all = Number(input[0]);
    var maxest = Number(tmp[0]);
    ans = 1;
    for(i = 1; i < all; i++){
        the_Num = tmp[i];
        if(maxest > the_Num){
            ans++;
        }
        if(maxest > the_Num) maxest = the_Num;

    }
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
