#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::vector<int> a(n);
  for (int i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  float ave = std::accumulate(a.begin(), a.end(), 0) / a.size();
  int min_index = 0;
  float min_value = 100;
  for (int i = 0; i < n; i++) {
    float value = std::abs(a[i] - ave);
    if (value < min_value) {
      min_index = i;
      min_value = value;
    }
  }
  std::cout << min_index << "\n";
  return 0;
}
