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