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