fun main(args: Array<String>) {
    abc152c()
}

fun abc152c() {
    val n = readLine()!!.toInt()
    val pList = readLine()!!.split(' ').map { it.toLong() }

    var currMin = Long.MAX_VALUE / 10
    var answer = 0L

    for (p in pList) {
        if (p <= currMin) answer++

        currMin = Math.min(currMin, p)
    }

    println(answer)
}
