#include <bits/stdc++.h>
using namespace std;
int int_sort(const void *a, const void *b) { return *(int *)b - *(int *)a; }
int main() {
  int N, sum = 0, min;
  int a[101] = {};
  int flag = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum = sum / N;
  for (int i = 0; i < N; i++) {
    a[i] = a[i] - sum;
    if (a[i] < 0) a[i] = a[i] * (-1);
  }
  min = a[0];
  flag = 0;
  for (int i = 1; i < N; i++) {
    if (a[i] < min) flag = i;
  }
  cout << flag;
}
