#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  std::vector<int> h;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    h.push_back(tmp);
  }
  int count = 0;
  for (int i = 1; i < N; i++) {
    int ni = h[i];
    bool canlook = false;
    for (int j = i - 1; j < i; j++) {
      if (ni > h[j]) {
        canlook = true;
      } else {
        canlook = false;
      }
    }
    if (canlook == true) {
      count += 1;
    }
  }
  cout << count << endl;
  return 0;
}
