#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 100010;
const int MX = 123456;
const int mod = (int)1e9 + 7;
const int base = 1023456789;
const unsigned long long BS1 = 10000019ULL;
const int INF = (1 << 29);
template <class T>
inline void fastScan(T &x) {
  register char c = getchar();
  int neg = 0;
  x = 0;
  for (; (c < 48 || c > 57) && (c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
int n;
float inp[N];
int main() {
  fastScan(n);
  float sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%f", &inp[i]);
    sum += inp[i];
  }
  float avg = sum / (1.0 * n);
  int idx = 0, dist = 1000.0;
  for (int i = 0; i < n; i++) {
    if (fabs(inp[i] - avg) < dist) {
      idx = i;
      dist = fabs(inp[i] - avg);
    }
  }
  printf("%d\n", idx);
}
