#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, sum = 0, ans = 1000, index;
  int a[100];
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  sum /= N;
  for (int i = 0; i < N; ++i) {
    if (abs(ans - sum) > abs(a[i] - sum)) {
      ans = a[i];
      index = i;
    }
  }
  cout << index << endl;
  return 0;
}
