#include <bits/stdc++.h>
using namespace std;
void file() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  file();
  int n, sum = 0;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    sum += x;
    v.push_back(x);
  }
  float avg = sum / n;
  int diff = 100000000;
  int j = 0;
  for (int i = 0; i < n; ++i) {
    if (abs(avg - v[i]) < diff) {
      diff = abs(avg - v[i]);
      j = i;
    }
  }
  cout << j << "\n";
}
