#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  int sum = 0;
  for (int i = 0; i < N; i++) {
    sum += a[i];
  }
  double ave = sum / N;
  double dist_min = 101;
  int ans;
  for (int i = 0; i < N; i++) {
    double dist = abs(ave - a[i]);
    if (dist < dist_min) {
      dist_min = dist;
      ans = i;
    }
  }
  cout << ans << endl;
}
