#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[110], sum = 0, ave = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  ave = sum / n;
  int mn = 1000;
  int b;
  for (int i = 0; i < n; i++) {
    if (mn > abs(ave - a[i])) {
      mn = min(mn, abs(ave - a[i]));
      b = i;
    }
  }
  cout << b << endl;
  return 0;
}
