#include <bits/stdc++.h>
using namespace std;
int n;
int a[110];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  while (cin >> n) {
    int sum = 0;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      sum += a[i];
    }
    double aver = sum / (1.0 * n);
    int idx = 0, minn = abs(aver - 1.0 * a[0]);
    for (int i = 1; i < n; ++i) {
      if (abs(aver - 1.0 * a[i]) - minn < 1e-10) {
        minn = abs(aver - 1.0 * a[i]);
        idx = i;
      }
    }
    cout << idx << endl;
  }
  return 0;
}
