#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[109];
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum /= n;
  int temp = 100000;
  for (int i = 0; i < n; i++) {
    temp = min(temp, abs(a[i] - sum));
  }
  for (int i = 0; i < n; i++) {
    if (temp == abs(a[i] - sum)) {
      cout << i << endl;
      return (0);
    }
  }
  return (0);
}
