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