#include <bits/stdc++.h>
using namespace std;
double a[110], b[110], ans, sum;
int n, ansi;
int main() {
  int i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%f", &a[i]);
  sum = 0;
  for (i = 0; i < n; i++) sum += a[i];
  double k = sum * 1.0 / (n * 1.0);
  for (i = 0; i < n; i++) b[i] = abs(a[i] - k);
  ans = b[0];
  ansi = 0;
  for (i = 0; i < n; i++)
    if (b[i] < ans) {
      ans = b[i];
      ansi = i;
    }
  printf("%d\n", ansi);
  return 0;
}
