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