#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int a[100];
  int ave;
  int sum = 0;
  int diff_min = 200;
  int min_index;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  ave = sum / N;
  for (int i = 0; i < N; i++) {
    if (diff_min > abs(ave - a[i])) {
      diff_min = abs(ave - a[i]);
      min_index = i;
    }
  }
  cout << min_index << endl;
}
