let () =
  Scanf.scanf "%d" @@ fun n ->
  let p = Array.init n (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  Array.fold_left (fun (ans, u) v ->
    if u > v then (ans+1, v) else (ans, u)) (0, 200001) p
  |> fst |> Printf.printf "%d\n"
