#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[100], dis[100];
  int sum = 0;
  int samune = 1000;
  int ans = 1000;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (int i = 0; i < N; i++) {
    dis[i] = fabs((sum / N) - a[i]);
    if (dis[i] < samune) {
      samune = dis[i];
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
