#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int i, n, ans;
  int tmp = 101;
  float sum = 0;
  vector<int> a(n);
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a.at(i);
    sum += a.at(i);
  }
  if (n != 0) {
    sum /= n;
  } else {
    ans = 0;
  }
  for (i = 0; i < n; i++) {
    if (a.at(i) - sum >= 0) {
      if (a.at(i) - sum < tmp) {
        tmp = a.at(i) - sum;
        ans = i;
      }
    } else {
      if (sum - a.at(i) < tmp) {
        tmp = sum - a.at(i);
        ans = i;
      }
    }
  }
  cout << ans << endl;
}
