#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int m[10], count = 0;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    if (m[i] <= m[i - 1]) count++;
  }
  cout << count;
}
