#include <bits/stdc++.h>
using ll = long long;
constexpr ll MOD = 1000000007;
using std::cin;
using std::cout;
using std::endl;
using std::list;
using std::map;
using std::multimap;
using std::multiset;
using std::pair;
using std::queue;
using std::set;
using std::sort;
using std::stack;
using std::string;
using std::unordered_map;
using std::unordered_multimap;
using std::unordered_set;
using std::vector;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll pow(ll a, ll b) {
  ll ans = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      ans *= a;
      ans %= MOD;
    }
    b /= 2;
    a *= a;
    a %= MOD;
  }
  return ans;
}
ll comb(ll a, ll b) {
  if (a - b < b) {
    return comb(a, a - b);
  }
  static unordered_map<ll, ll> memo;
  ll c = 1;
  for (ll i = (ll)(a - b + 1); i < (ll)(a + 1); ++i) {
    c *= i;
    c %= MOD;
  }
  if (memo.find(b) == memo.end()) {
    ll k = 1;
    for (ll i = (ll)(2); i < (ll)(b + 1); ++i) {
      k *= i;
      k %= MOD;
    }
    memo[b] = pow(k, MOD - 2);
  }
  c *= memo[b];
  return c % MOD;
}
multiset<ll> prime_decomposition(ll n) {
  ll i = 2;
  multiset<ll> table{};
  while (i * i <= n) {
    while (n % i == 0) {
      n /= i;
      table.emplace(i);
    }
    ++i;
  }
  if (n > 1) {
    table.emplace(n);
    return table;
  }
  return table;
}
bool in(ll x1, ll y1, ll x2, ll y2, ll xn, ll yn) {
  return (x1 <= xn && xn <= x2 && y1 <= yn && yn <= y2);
}
int main() {
  double n;
  cin >> n;
  vector<double> v(n);
  for (ll i = (ll)(0); i < (ll)(n); ++i) {
    cin >> v[i];
  }
  double sum = 0;
  for (const auto& x : (v)) {
    sum += x;
  }
  double ave = sum / n;
  ll t = 0;
  double min = 1e10;
  for (ll i = (ll)(0); i < (ll)(v.size()); ++i) {
    double dis = abs(ave - v[i]);
    if (dis < min) {
      min = dis;
      t = i;
    }
  }
  cout << t << endl;
}
