#include <bits/stdc++.h>
int main(int, char*[]) {
  int num, min, sum = 0;
  std::vector<int> frames;
  std::cin >> num;
  frames.resize(num);
  for (int i = 0; i < num; i++) {
    int tmp;
    std::cin >> tmp;
    frames[i] = tmp;
    sum += frames[i];
  }
  min = 100 * 100;
  int ret = 0;
  for (int i = 0; i < num; i++) {
    int nodd;
    int diff = frames[i] * num;
    if (diff == sum) {
      std::cout << ret << std::endl;
      return ret;
    }
    if (diff > sum) {
      nodd = diff - sum;
    } else {
      nodd = sum - diff;
    }
    if (min > nodd) {
      min = nodd;
      ret = i;
    }
  }
  std::cout << ret << std::endl;
  return ret;
}
