#include <bits/stdc++.h>
int main() {
  int a[100], b[100];
  int n, i, j, sum = 0, average, c = 101;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum = sum + a[i];
    if (i == n - 1) average = sum / n;
  }
  for (j = 0; j < n; j++) {
    b[j] = (average - a[j]) * (average - a[j]);
    if (c > b[j]) c = j;
  }
  printf("%d", c);
}
