#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
int main() {
  int N, a[100], ave = 0;
  cin >> N;
  vector<pair<int, int>> pair<int, int>(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= N;
  for (int i = 0; i < N; i++) {
    pair<int, int>[i] = make_pair(abs(ave - a[i]), i);
  }
  sort(pair<int, int>.begin(), pair<int, int>.end());
  cout << pair<int, int>[0].second << endl;
  return 0;
}
