#include <bits/stdc++.h>
using namespace std;
const int maxn = 10000 + 50;
int s[maxn];
int main() {
  int n;
  int minn = 1 << 30;
  long long sum = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
    sum += s[i];
  }
  double p;
  p = 1.0 * sum / n;
  long long ans;
  for (int i = 0; i < n; ++i) {
    if (abs(s[i] - p) < minn) {
      minn = abs(s[i] - p);
      ans = i;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
