#include <bits/stdc++.h>
using namespace std;
long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return b;
  } else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return a / gcd(a, b) * b;
}
long long a[100];
signed main() {
  long long n;
  cin >> n;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  double d = sum / n;
  pair<long long, long long> ans;
  ans.first = 2000000000;
  for (long long i = 0; i < n; i++) {
    long long b = (a[i] - d < 0) ? d - a[i] : a[i] - d;
    if (ans.first > b) {
      ans.first = b;
      ans.second = i;
    }
  }
  cout << ans.second << endl;
}
