package main import ( "fmt" ) func main() { var N int var arr [100000]int fmt.Scan(&N) for i := 0; i < N; i++ { fmt.Scan(&arr[i]) } ret := 0 for i := 0; i < N; i++ { if i > 0 && arr[i-1] > arr[i] { ret++ } } fmt.Println(ret) }