#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int sum = 0;
  int a[110];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  int average = sum / n;
  int tmp = INF, ans;
  for (int i = 0; i < n; ++i) {
    tmp = min(tmp, abs(average - a[i]));
  }
  for (int i = 0; i < n; ++i) {
    if (abs(average - a[i]) == tmp) {
      ans = i;
      break;
    }
  }
  cout << ans << '\n';
  return 0;
}
