#include <bits/stdc++.h>
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 924844033;
const ll root = 62;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
ll binpow(ll a, ll b) {
  ll res = 1;
  while (b) {
    if (b & 1) res = (res * a) % MOD;
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
ll modInv(ll a) { return binpow(a, MOD - 2); }
const double PI = acos(-1);
const double eps = -1e6;
const int INF = 0x3f3f3f3f;
const int NINF = 0xc0c0c0c0;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll NINFLL = 0xc0c0c0c0c0c0c0c0;
const int mxN = 101;
int n;
int arr[mxN];
int main() {
  freopen("file.in", "r", stdin);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  cin.tie(0)->sync_with_stdio(0);
  cin >> n;
  int sum = 0;
  for (int i = (0); i < (n); ++i) {
    cin >> arr[i];
    sum += arr[i];
  }
  int ans = 0;
  int diff = INF;
  for (int i = (0); i < (n); ++i) {
    if (abs(arr[i] * n - sum) < diff) {
      diff = abs(arr[i] * n - sum);
      ans = i;
    }
  }
  cout << ans << "\n";
  return 0;
}
