#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a[123];
  scanf("%d", &N);
  for (long long i = 0; i < (N); ++i) scanf("%d", &a[i]);
  double sum = 0;
  for (long long i = 0; i < (N); ++i) sum += a[i];
  sum /= N;
  double n_n = abs(sum - a[0]);
  int n_i = 0;
  for (long long i = 0; i < (N); ++i) {
    if (n_n > abs(sum - a[i])) {
      n_i = i;
    }
  }
  printf("%d\n", n_i);
  return 0;
}
