#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  int a, q = 10000, w = 0;
  int b[10000];
  double c = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> b[i];
    c += b[i];
  }
  c /= a;
  for (int i = 0; i < a; i++) {
    if (abs(b[i] - c) < q) w = i, q = abs(b[i] - c);
  }
  cout << w << "\n";
}
