#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using ll = long long;
const ll INF = 1001001001;
using graph = vector<vector<ll>>;
const ll mod = 1000000007;
ll gcd(ll a, ll b) {
  if (a < b) swap(a, b);
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
bool isp(ll n) {
  bool res = true;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      res = false;
      break;
    }
  }
  return res;
}
ll ctoi(char c) {
  if (c == '0')
    return 0;
  else if (c == '1')
    return 1;
  else if (c == '2')
    return 2;
  else if (c == '3')
    return 3;
  else if (c == '4')
    return 4;
  else if (c == '5')
    return 5;
  else if (c == '6')
    return 6;
  else if (c == '7')
    return 7;
  else if (c == '8')
    return 8;
  else if (c == '9')
    return 9;
  else
    return -1;
}
int main() {
  ll N;
  cin >> N;
  ld avr = 0;
  vector<ll> num(N);
  for (ll i = 0; i < N; i++) {
    cin >> num[i];
    avr += num[i];
  }
  avr /= N;
  ld sa = 1000;
  for (ll i = 0; i < N; i++) {
    sa = min(sa, abs(avr - num[i]));
  }
  for (ll i = 0; i < N; i++) {
    if (abs(avr - num[i]) == sa) {
      cout << i << endl;
      break;
    }
  }
}
