#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int n, a[105], avg = 0, ans = 0, diff = (1 << 30);
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    avg += a[i];
  }
  avg /= n;
  for (int i = 0; i < n; i++) {
    if (diff > abs(avg - a[i])) {
      ans = i;
      diff = abs(avg - a[i]);
    }
  }
  cout << ans << endl;
  return 0;
}
