#include <bits/stdc++.h>
int main(void) {
  int n;
  double avg = 0;
  std::cin >> n;
  std::vector<int> v(n);
  for (size_t i = 0; i < n; i++) {
    std::cin >> v[i];
  }
  avg = 1.0 * std::accumulate(v.begin(), v.end(), 0LL) / v.size();
  int pos, min = 100000;
  for (size_t i = 0; i < n; i++) {
    if (min > std::abs(avg - v[i])) {
      pos = i;
      min = std::abs(avg - v[i]);
    }
  }
  std::cout << pos << std::endl;
  return 0;
}
