#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a[100], min_i = 101, min_diff = 101, sum = 0, mean = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  mean = sum / N;
  for (int i = 0; i < N; i++) {
    if (abs(a[i] - mean) < min_diff) {
      min_diff = abs(a[i] - mean);
      min_i = i;
    }
  }
  cout << min_i << endl;
  return 0;
}
