#include <bits/stdc++.h>
const long long INF = 1LL << 60;
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main(void) {
  int N, i, a[101];
  double ave = 0, min = 1000;
  cin >> N;
  for (i = 0; i <= N - 1; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= (double)N;
  for (i = 0; i <= N - 1; i++) {
    chmin(min, abs(ave - a[i]));
  }
  for (i = 0; i <= N - 1; i++) {
    if (abs(ave - a[i]) == min) {
      cout << i << endl;
      break;
    }
  }
  return 0;
}
