#include<iostream>
#include<string>
#include<cmath>

using namespace std;

int main() {
	int n, a[100],ans;
	float sum = 0,min=101.0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		sum += a[i];
	}
	sum /= n;
	for (int i = 0; i < n; i++) {
		if (fabs(a[i] - sum) == min)continue;
		if (fabs(a[i] - sum) < min){
          	min = fabs(a[i] - sum);
			ans = i;

        }
	}
	cout << ans;
}
#include <iostream>

int main(void){
    int N, ans=40;
    std::cin >> N;

    for (int i=0; i<N; ++i){
        int a, cnt=0;
        std::cin >> a;
        while (a % 2 == 0){
            a /= 2;
            ++cnt;
        }
        if (cnt < ans) ans = cnt;
    }

    std::cout << ans << std::endl;

    return 0;
}
