#include <bits/stdc++.h>
using namespace std;
int INF = 2147483647;
long long LINF = 9223372036854775807;
long long MOD = 1000000007;
int main() {
  int N;
  cin >> N;
  int a[N];
  int ave = 0;
  int ans;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= N;
  ans = 0;
  for (int i = 0; i < N - 1; ++i) {
    if (abs(ave - a[i + 1]) < abs(ave - a[ans])) ans = i + 1;
  }
  cout << ans << endl;
  return 0;
}
