#include <bits/stdc++.h>
using namespace std;
double a[200];
signed main() {
  int n;
  cin >> n;
  double ave = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= n;
  int ans = 0;
  int res = a[0];
  for (int i = 0; i < n; i++) {
    int t = abs(ave - a[i]);
    if (res > t) {
      ans = i;
      res = t;
    }
  }
  cout << ans << endl;
  return 0;
}
