#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
  }
  float avg = 0;
  avg = sum / n;
  for (int i = 0; i < n; i++) {
    if (a[i] == avg) {
      printf("%d\n", i);
      return 0;
    } else if (a[i] > avg) {
      printf("%d\n", i - 1);
      return 0;
    }
  }
  return 0;
}
