#include <bits/stdc++.h>
#define abs(x) (x>0?x:-x)
int main( ) {
int n, a[101], sum, ans;
for (int i=0; i<n; ++i) std::cin >> a[i], sum += s[i];
double av = (double)sum/n;
for (int i=1; i<n; ++i) if ( abs(a[ans]-av) > abs(a[i]-av) ) ans =i;
std::cout << ans;
}