#include <bits/stdc++.h>
using namespace std;
bool is_prime(long long int x) {
  for (long long int i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
int main() {
  long long int A, B, C = 999999999, D = 0, E = 0, F = 0, G = 0, H = 0, N, M;
  cin >> N;
  vector<int> P(N, 0);
  for (long long int i = 0; i < N; i++) {
    cin >> P[i];
    D += P[i];
  }
  D /= N;
  for (long long int i = 0; i < N; i++) {
    if (D == P[i]) {
      cout << i << endl;
      break;
    }
  }
}
