// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}


func main() {
    let n = readInt()
    let aryP = readInts()
    //_________________________ここまで入力
    
    /// 最小値
    var m = Int.max
    var ans = 0
    for i in 0..<n {
        if aryP[i] <= m {
            m = aryP[i]
            ans += 1
        }
    }
    print(ans)
}

main()



