#include <bits/stdc++.h>
int main() {
  int n;
  int sum = 0;
  int minIndex;
  double ave;
  double dMin = 101;
  std::vector<int> aList;
  std::cin >> n;
  aList.resize(n);
  for (int i = 0; i < n; i++) std::cin >> aList[i];
  for (int i = 0; i < n; i++) sum += aList[i];
  ave = double(sum / n);
  for (int i = 0; i < n; i++) {
    if (dMin > std::fabs(double(ave - aList[i]))) {
      dMin = std::fabs(double(ave - aList[i]));
      minIndex = i;
    }
  }
  std::cout << minIndex << std::endl;
  return 0;
}
