#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100], p = 0, q = 1145141919, ans;
  double d;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    p += a[i];
  }
  d = p / n;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] - d) < q) {
      ans = i;
      q = abs(a[i] - d);
    }
  }
  cout << ans << endl;
}
