#include <bits/stdc++.h>
using namespace std;
int vis[101], a[101];
int n;
int main() {
  double sum = 0;
  memset(vis, -1, sizeof(vis));
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    if (vis[a[i]] != -1) continue;
    vis[a[i]] = i;
  }
  sort(a, a + n);
  sum = sum / (n * 1.0);
  int minn = 0;
  for (int i = 0; i < n; i++) {
    if (fabs(minn - sum) > fabs(a[i] - sum)) minn = a[i];
  }
  cout << vis[minn] << endl;
  return 0;
}
