#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const ll MM = 1000000000;
const ll mod = MM + 7;
int main() {
  int n;
  cin >> n;
  int a[101];
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    count += a[i];
  }
  double ave = count / n * 1.000;
  double mn = 100, mn_i = -1;
  double diff = 0;
  for (int i = 0; i < n; i++) {
    diff = (a[i] - ave) * 1.000;
    if (diff < 0) diff *= -1.000;
    if (diff < mn) {
      mn = diff;
      mn_i = i;
    }
  }
  cout << mn_i << endl;
}
