import java.util.*
import java.util.ArrayDeque

fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val n = sc.nextInt()
    val p = sc.asSequence().take(n).map { it.toInt() }.toList()

    var min = Int.MAX_VALUE
    var r = 0
    p.forEach {
        if (it <= min) {
            r++
            min = it
        }
    }
    print(r)
}
