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

let rec f ls min cnt =
 match ls with
 | [] -> cnt
 | hd :: tl -> if (hd < min) then f tl hd (cnt + 1)
               else f tl min cnt

f p (n + 1) 0
|>stdout.WriteLine