#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
  string s, t;
  ll n, m;
  cin >> n;
  double x[1000] = {};
  for (int i = 0; i < n; i++) {
    cin >> a;
    x[i] = a;
  }
  double sum = 0;
  for (int i = 0; i < n; i++) {
    sum += x[i];
  }
  sum /= n;
  double mini = 100000000;
  for (int i = 0; i < n; i++) {
    if (mini > abs(sum - x[i])) {
      mini = min(abs(sum - x[i]), mini);
      b = i;
    }
  }
  cout << b << endl;
  return 0;
}
