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