#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a[110], s, m = 1e10;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  for (int i = 0; i < n; i++) m = min(m, abs(n * a[i] - s));
  for (int i = 0; i < n; i++)
    if (abs(n * a[i] - s) == m) {
      cout << i << endl;
      return 0;
    }
}
