"use strict"
function main(arg) {
    var data = arg.split("\n")[1].split(" ").map(Number)
    var min_i = 0
    var min_v = data[0]
    var count = 1
    for (var i = 1; i < data.length; i++) {
        // console.log(i)
        if (min_v >= data[i]) {
            // ok
            count++
            min_v = data[i]
        }
    }
    console.log(count)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));