#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  std::vector<int> v(n);
  for (int i = 0; i < n; i++) {
    std::cin >> v.at(i);
  }
  int total = 0;
  for (int i = 0; i < n; i++) {
    total += v.at(i);
  }
  int avg = total / n;
  int thumbnail = 0;
  for (int i = 1; i < n; i++) {
    if (abs(avg - v.at(i)) < abs(avg - v.at(thumbnail))) {
      thumbnail = i;
    }
  }
  std::cout << thumbnail << '\n';
  return 0;
}
