#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int LARGE_INT = 1e9 + 100;
const int INF = 2e9 + 100;
const long long INF_LL = (long long)INF * 300 * 300;
const int MOD = 1e9 + 7;
long long modpow(long long a, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return res;
}
void Main() {
  int n;
  cin >> n;
  double mean = 0;
  vector<double> a(n);
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
    mean += a[i];
  }
  mean /= n;
  int result = 0;
  double diff = 1000;
  for (int i = (0); i < (n); ++i) {
    if (abs(mean - a[i]) < diff) {
      diff = mean - a[i];
      result = i;
    }
  }
  cout << result << endl;
  return;
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
  return 0;
}
