#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  long long a[100], sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  double av = (double)sum / n;
  long long d = (1 << 28), ans;
  for (long long i = 0; i < n; i++) {
    if (d > abs(a[i] - av)) {
      ans = i;
      d = abs(a[i] - av);
    }
  }
  cout << ans << endl;
  return 0;
}
