#include <bits/stdc++.h>
using namespace std;
void no() {
  cout << "No" << endl;
  exit(0);
}
void yes() {
  cout << "Yes" << endl;
  exit(0);
}
void No() {
  cout << "NO" << endl;
  exit(0);
}
void Yes() {
  cout << "YES" << endl;
  exit(0);
}
using namespace std;
int main() {
  int n, a[110];
  cin >> n;
  for (int i = (0); i < (n); i++) cin >> a[i];
  int sum = 0;
  for (int i = (0); i < (n); i++) sum += a[i];
  int ave = sum / n;
  int ans = 200, tmp = 200;
  for (int i = (0); i < (n); i++) {
    int sa = abs(a[i] - ave);
    if (sa < tmp) {
      tmp = sa;
      ans = i;
    }
    if (sa = tmp && i < ans) {
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
