#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int sum = 0;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    sum += a[i];
  }
  double ave = sum / n;
  double min_d = 101;
  int res = 0;
  for (int i = 0; i < (n); ++i) {
    if (abs(ave - a[i]) < min_d) {
      min_d = abs(ave - a[i]);
      res = i;
    }
  }
  cout << res << endl;
  return 0;
}
