fun main(args: Array<String>) {
    val n = readLine()!!.toLong()
    var ps = readLine()!!.split(" ").map { it.toLong() }
    var max = Long.MAX_VALUE
    var ans = 0L
    for (p in ps) {
        if (p <= max) {
            ans++
            max = p
        }
    }
    println(ans)

}
