#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000001;
struct edge {
  int to, cost;
};
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
struct Road {
  double cost;
  int a, b;
};
int main() {
  int n;
  int a[101];
  double t = 0;
  int r = 100000, l = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    t += a[i];
  }
  t = t / n;
  for (int i = 0; i < n; ++i) {
    if (abs(a[i] - t) < r) {
      l = i;
      r = abs(a[i] - t);
    }
  }
  cout << l << endl;
  return 0;
}
