#include <bits/stdc++.h>
using namespace std;
int n;
int a[101];
double sum = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum = sum / (double)n;
  int res = 0;
  double k = 1000;
  for (int i = 0; i < n; i++) {
    double test;
    test = sum - a[i];
    if (test <= 0) {
      test = -test;
    }
    if (test < k) {
      res = i;
      k = abs(sum - a[i]);
    }
  }
  cout << res;
  return 0;
}
