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