#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a[110];
  double sum = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum = sum / (double)N;
  pair<int, int> b[110];
  for (int i = 0; i < N; i++) {
    b[i].first = abs(a[i] - sum);
    b[i].second = i;
  }
  sort(b, b + N);
  cout << b[0].second << endl;
}
