#include <bits/stdc++.h>
using namespace std;
struct edge {
  int to, cost;
};
const int INF = 100000000;
int main() {
  int n, a[110], sum = 0, ans = 0;
  double d;
  cin >> n;
  for (int i = 0; i < (n); i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (int i = 0; i < (n); i++) {
    if (sum / n == a[i]) {
      ans = i;
    }
  }
  if (sum % n != 0) {
    cout << 0 << endl;
  } else {
    cout << ans << endl;
  }
  return 0;
}
