#include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
int main() {
  int N, a[MAX];
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> a[i];
  double sum = 0;
  for (int i = 0; i < N; ++i) sum += a[i];
  sum /= N;
  double diff = abs(sum - a[0]), eps = 0.00001;
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    if (diff > eps + abs(sum - a[i])) ans = i;
  }
  cout << ans;
  return 0;
}
