#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
const long double EPS = 1e-9L;
inline int sgn(const long double &r) { return (r > EPS) - (r < -EPS); }
inline long double sq(long double x) { return sqrt(max(x, 0.0L)); }
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int main() {
  int n;
  cin >> n;
  int sum = 0;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  double ave = (double)sum / (double)n;
  int near = 10000;
  int ans;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] - ave) < near) {
      near = abs(a[i] - ave);
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
