#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double a[100];
  double s = 0.0;
  for (int i = 0; i = !n; i++) {
    cin >> a[i];
    s += a[i];
  }
  double heikin = s / n;
  double small = 100.0;
  int ans;
  for (int i = 0; i = !n; i++) {
    if (a[i] - heikin < small) {
      ans = i;
    } else if (a[i] - heikin == small) {
      if (ans > i) {
        ans = i;
      }
    }
  }
  cout << ans << endl;
}
