#include <bits/stdc++.h>
int main() {
  int n;
  int *frame;
  double *dist;
  int i;
  int target = 0;
  int total = 0;
  double average, min = 100.0;
  scanf("%d", &n);
  frame = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) {
    scanf("%d", &frame[i]);
    total += frame[i];
  }
  average = (double)total / n;
  for (i = 0; i < n; i++) {
    if (min > (average - (double)frame[i])) {
      min = average - (double)frame[i];
      target = i;
    }
  }
  printf("%d", target);
  free(frame);
  free(dist);
}
