#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  int n, k[105], sum = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> k[i];
    sum += k[i];
  }
  double mon = sum / n, ans = 9999, mm;
  for (int i = n - 1; i >= 0; --i) {
    if (abs(k[i] - mon) < ans) {
      ans = k[i] - mon;
      mm = i;
    }
  }
  cout << mm << endl;
}
