#include <bits/stdc++.h>
double abs(double x) {
  if (x < 0)
    return -x;
  else
    return x;
}
int main() {
  int N;
  int a[101];
  int i;
  int sum = 0;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  double average = sum / N;
  double subs = 100;
  int reminder = 0;
  for (i = 0; i < N; i++) {
    if (average == (double)a[i]) {
      printf("%d", i);
      return 0;
    } else if (abs(average - (double)a[i]) < subs) {
      subs = abs(average - (double)a[i]);
      reminder = i;
    }
  }
  printf("%d", reminder);
  return 0;
}
