#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int hIdx = 0;
  for (int i = 0; i < N; i++) {
    int h;
    cin >> h;
    if (h > hIdx) {
      hIdx = i;
    }
  }
  cout << hIdx;
  return 0;
}
