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