#include <bits/stdc++.h>
using namespace std;
using dou = long double;
string yes = "yes";
string Yes = "Yes";
string YES = "YES";
string no = "no";
string No = "No";
string NO = "NO";
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int INF = 2000000000;
const long long INF64 = 922337203685477580ll;
const long long MOD = 1000000007ll;
const dou pi = 3.141592653589793;
int main() {
  int n;
  std::cin >> n;
  std::vector<dou> a(n);
  for (int i = 0; i < (int)(n); i++) std::cin >> a[i];
  ;
  dou d = accumulate((a).begin(), (a).end(), 0ll) / n;
  dou min = 10000;
  int miv;
  for (int i = 0; i < (int)(n); i++) {
    if (min > abs(a[i] - d)) {
      miv = i;
      min = abs(a[i] - d);
    }
  }
  std::cout << miv << std::endl;
}
