open Printf
open Scanf

let id x = x

let solve n =
  let ar = Array.init n @@ fun _ -> scanf "%d " id in
  let f (ct, mn) x = if mn > x then (ct + 1, x) else (ct, mn) in
  fst @@ Array.fold_left f (0, 300000) ar

let () =
  scanf "%d " solve |> printf "%d\n"
