#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int h[21];
  cin >> h[1];
  int x = 1;
  int flag = 0;
  for (int i = 2; i <= n; i++) {
    cin >> h[i];
    if (h[i] >= h[i - 1] && flag == 0) {
      x++;
    } else
      flag = 1;
  }
  cout << x << endl;
  return 0;
}
