let n = stdin.ReadLine() |> int
let a = stdin.ReadLine().Split() |> Array.map int

let rec loop c m s =
    if c = n then s
    else
        if a.[c] <= m then loop (c + 1) a.[c] (s + 1)
        else loop (c + 1) m s

loop 0 n 0 |> printfn "%d"