#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, difmin = 1000;
  int ave = 0, ans = 0;
  ;
  int a[100];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= (double)n;
  for (int i = 0; i < n; i++) {
    int x = fabs(a[i] - ave);
    if (x < difmin) {
      difmin = x;
      ans = i;
    }
  }
  cout << ans << endl;
}
