#include<bits/stdc++.h>
using namespace std;

int main(){
    double N;
    cin >> N;
    vector<double>a(N);
    double wa = 0;
    for(int i = 0; i < N; i++) {
        cin >> a[i];
        wa+=a[i];
    }
    wa /=N;
    double a = 777;
    for(int i = 0; i < N; i++) {
        a = min(a,abs(goukei-a[i]));
    }
    for(int i = 0; i < N; i++) {
        if(abs(goukei-a[i]) == sa) {
            cout << i << endl;
            return 0;
        }
    }
} 
