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