#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<int> v(N);
  int sum = 0;
  for (int i = 0; i < N; ++i) {
    std::cin >> v[i];
    sum += v[i];
  }
  double avg = static_cast<double>(sum / N);
  double min_dist = 999;
  int index = -1;
  for (int i = 0; i < N; ++i) {
    double value = static_cast<double>(v[i]);
    double dist = std::fabs(value - avg);
    if (dist < min_dist) {
      min_dist = dist;
      index = i;
    }
  }
  std::cout << index << std::endl;
}
