#include <bits/stdc++.h>
using namespace std;
int a[100];
int main() {
  int N;
  cin >> N;
  double sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum = sum + a[i];
  }
  double ave = sum / N;
  int tempIndex = 0;
  double min = 101;
  int flag = 0;
  double temp = 0;
  for (int i = N; i >= 0; i--) {
    if (a[i] > ave) {
      temp = a[i] - ave;
    } else {
      temp = ave - a[i];
    }
    if (a[i] == int(ave)) {
      tempIndex = i;
      flag = 1;
    } else if (min >= temp && flag == 0) {
      tempIndex = i;
    }
  }
  cout << tempIndex << endl;
}
