#include <bits/stdc++.h>
using namespace std;
double All[105];
int main() {
  double all = 0.0, ans = 100000000.0;
  int how, i, N;
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    scanf("%lf", &All[i]);
    all += All[i];
  }
  for (i = 0; i < N; i++) {
    if (abs(All[i] - all / (double)N) < ans) {
      how = i;
      ans = abs(All[i] - all / (double)N);
    }
  }
  printf("%d\n", how);
  return 0;
}
