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