#include <bits/stdc++.h>
using namespace std;
struct point {
  int x;
  int y;
};
int gcd(int m, int n) {
  if ((0 == m) || (0 == n)) return 0;
  while (m != n) {
    if (m > n)
      m = m - n;
    else
      n = n - m;
  }
  return m;
}
int lcm(int m, int n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / gcd(m, n)) * n);
}
int input() {
  int x;
  cin >> x;
  return x;
}
int moji(char in) {
  int ans = (int)in - (int)'a';
  if ((ans < 0) || (ans > 25)) {
    ans = 26;
  }
  return ans;
}
const int VV = 10;
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s) {
  fill(d, d + VV, 100000);
  fill(used, used + VV, false);
  d[s] = 0;
  while (true) {
    int v = -1;
    for (int u = 0; u < VV; u++) {
      if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
    }
    if (v == -1) break;
    used[v] = true;
    for (int u = 0; u < VV; u++) {
      d[u] = min(d[u], d[v] + cost[v][u]);
    }
  }
}
int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  int N;
  cin >> N;
  int a[N];
  double sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum += (double)a[i];
  }
  sum /= N;
  double min = 100;
  int minidx = 1000;
  for (int i = 0; i < N; i++) {
    if (abs(sum - a[i]) < min) {
      min = abs(sum - a[i]);
      minidx = i;
    }
  }
  cout << minidx << endl;
}
