#include <bits/stdc++.h>
using namespace std;
int par[int(0x7ffffff)];
int Rank[int(0x7ffffff)];
void init(int n) {
  for (int i = 0; i < n; i++) {
    par[i] = i;
    Rank[i] = 0;
  }
}
int find(int x) {
  if (par[x] == x) {
    return x;
  } else {
    return par[x] = find(par[x]);
  }
}
void unite(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) return;
  if (Rank[x] < Rank[y]) {
    par[x] = y;
  } else {
    par[y] = x;
    if (Rank[x] == Rank[y]) Rank[x]++;
  }
}
bool same(int x, int y) { return find(x) == find(y); }
int main() {
  int n;
  cin >> n;
  int a[100];
  int averange = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    averange += a[i];
  }
  int res = (1e9);
  int ans = 0;
  averange = averange / n;
  for (int i = n - 1; i >= 0; i--) {
    if (res >= abs(averange - a[i])) {
      res = abs(averange - a[i]);
      ans = i;
    }
  }
  cout << ans << endl;
}
