#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;
int main() {
  double n, ave, tmp = 1000;
  int ans = 0;
  cin >> n;
  vector<int> thumb(n);
  for (int i = 0; i < (int)(n); i++) cin >> thumb[i];
  ave = accumulate(thumb.begin(), thumb.end(), 0) / n;
  for (int i = n - 1; i >= 0; i--) {
    if (abs(thumb[i] - ave) <= tmp) {
      ans = i + 1;
      tmp = abs(thumb[i] - ave);
    }
  }
  cout << ans << endl;
  return 0;
}
