#include <bits/stdc++.h>
using namespace std;
long long l = 1000000007;
float a[105] = {};
int main() {
  int n;
  int min = 150;
  int ans = 0;
  float ave;
  float sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    sum += a[i];
  }
  ave = sum / n;
  for (int i = 0; i < n; i++) {
    float x = 0;
    x = abs(a[i] - ave);
    if (x < min) {
      min = x;
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
