#include <bits/stdc++.h>
int n, a[110];
int main() {
  std::cin >> n;
  double ave = 0;
  for (int i = 0; i < n; ++i) {
    std::cin >> a[i];
    ave += a[i];
  }
  ave /= n;
  int diff = 1000000;
  int num = 0;
  for (int i = 0; i < n; ++i) {
    auto res = a[i] - ave;
    if (res < 0) res *= -1;
    if (res < diff) {
      diff = res;
      num = i;
    }
  }
  std::cout << num << std::endl;
  return 0;
}
