#include<iostream>
using namespace std;

int main(){
    int n;
    int a;
    int count = 1e9;
    cin >> n;
    for(int i = 0;i<n;i++){
        cin >> a;
        int key = 0;
        while(a%2 == 0){
            a /= 2;
            key++;
        }
        if(key<count){
            count = key;
        }
    }
    cout << count << endl;
    return 0;
}
#include <bits/stdc++.h>
#define rep(i,n) for(long long i = 0; i < (long long)(n); ++i)

using namespace std;
using ll = long long;

int main() {
	ll n, ans = 0;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		if (i % 3 == 0 || i % 5 == 0) continue;
		ans += i;
	}
	cout << ans << endl;
	return 0;
}
