#include <bits/stdc++.h>
using namespace std;
int a[1011];
int main() {
  int n, i, sum = 0, pl, mn = 10000000;
  double p;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]), sum += a[i];
  p = (double)sum / n;
  for (i = 1; i <= n; i++) {
    if (abs(p - a[i]) < mn) mn = abs(p - a[i]), pl = i - 1;
  }
  printf("%d\n", pl);
  return 0;
}
