[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main argv =
    let n = read int
    let hs = reads int
    List.fold (fun (s, t) h -> if t <= h then (s + 1, h) else (s, t)) (0, 0) hs
    |> fst
    |> printfn "%i"
    0