#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a, b, ans = 101, min = 999;
  int sum = 0, A[101];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    sum += A[i];
  }
  double average = sum / N;
  for (int i = 0; i < N; i++) {
    if (A[i] < average) {
      a = average;
      b = A[i];
    } else {
      a = A[i];
      b = average;
    }
    if (min > a - b) {
      min = a - b;
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
