#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll amari = 1e9 + 7;
int main() {
  int n;
  int a[100];
  double ave = 0.0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= 1.0 * n;
  int ans = 0;
  double ok = 99999999;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] - ave) < ok) {
      ok = abs(a[i] - ave);
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
