#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  long long s = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  s = s / n;
  long long tp = 0;
  long long mn = 1000;
  for (long long i = 0; i < n; i++) {
    if (abs(a[i] - s) < mn) {
      tp = i;
      mn = abs(a[i] - s);
    }
  }
  cout << tp << endl;
}
