#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
int h[maxn];
int main() {
  int n = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  int ans = 1;
  for (int i = n - 1; i >= 1; i--) {
    bool judge = true;
    for (int j = i - 1; j >= 0; j--) {
      if (h[j] > h[i]) {
        judge = false;
        break;
      }
    }
    if (judge) {
      ans = i;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
