#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b <= a) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0, i_len = (int)(n); i < i_len; i++) cin >> a[i];
  int sum = 0;
  for (int i = 0, i_len = (int)(n); i < i_len; i++) sum += a[i];
  float ave = sum / n;
  int pos = n - 1;
  float min = 101;
  for (int i = (int)(n)-1; 0 <= i; i--) {
    if (chmin(min, abs(a[i] - ave))) pos = i;
  }
  cout << pos << "\n";
}
