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