#include <bits/stdc++.h>
using namespace std;
bool codejam = 0;
void solve();
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(20);
  long long t = 1;
  long long tt = t;
  while (t--) {
    if (codejam) cout << "Case #" << tt - t << ": ";
    solve();
  }
  return 0;
}
const long long N = 105;
const long long inf = 1e9 + 7;
long long arr[N];
long long S = 0;
void solve() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    cin >> arr[i];
    S += arr[i];
  }
  long long mn = inf;
  long long ans;
  for (long long i = 1; i <= n; ++i) {
    if (llabs(S - n * arr[i]) < mn) {
      mn = llabs(S - n * arr[i]);
      ans = i;
    }
  }
  cout << ans;
}
