#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10, M = 1000 + 10;
int a[N];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, sum = 0;
  for (int i = 0; i < n; i++) cin >> a[i], sum += a[i];
  int id = 0;
  for (int i = 1; i < n; i++)
    if (abs(a[i] * n - sum) < abs(a[id] * n - sum)) id = i;
  cout << id << endl;
}
