#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v;
  int t;
  for (int _ = (0); _ < (n); ++_) {
    cin >> t;
    v.push_back(t);
  }
  int sum = accumulate((v).begin(), (v).end(), 0);
  int ave = (double)sum / (double)n;
  vector<int> diff(n);
  for (int i = (0); i < (n); ++i) {
    diff[i] = abs(v[i] - ave);
  }
  int res = 101;
  int itr = 0;
  for (int i = (0); i < (n); ++i) {
    if (diff[i] < res) {
      res = diff[i];
      itr = i;
    }
  }
  cout << itr;
}
