#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N];
  double sum = 0.0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum /= (double)N;
  for (int i = 0; i < N; i++) {
    if (sum == a[i]) {
      cout << i << endl;
      return 0;
    }
  }
  cout << 0 << endl;
  return 0;
}
