#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
int n, a[maxn], sum = 0, pos = -1;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  float s = sum / n, minn = ((int)(1e9));
  for (int i = 0; i < n; i++)
    if (abs(a[i] - s) < minn) {
      minn = abs(a[i] - s);
      pos = i;
    }
  cout << pos << endl;
  return 0;
}
