#include <bits/stdc++.h>
using namespace std;
double arr[100];
int main() {
  int N;
  scanf("%d", &N);
  double sum = 0.0;
  for (int i = 0; i < N; ++i) {
    scanf("%lf", &arr[i]);
    sum += arr[i];
  }
  double ave = sum / N;
  double diff = 12345;
  int idx = 0;
  for (int i = 0; i < N; ++i) {
    if (abs(ave - arr[i]) < diff) {
      idx = i;
      diff = abs(ave - arr[i]);
    }
    if (diff == 0.0) {
      break;
    }
  }
  printf("%d\n", idx);
  return 0;
}
