fun main(args: Array<String>) {
    val n = readLine()
    val plist = readLine()!!.split(" ").map { it.toInt() }

    var min = plist.first()
    var count = 0
    plist.forEach { 
        if (it <= min) {
            min = it
            count += 1
        }
    }
    print(count)
}