Problem:
 Score : 200 points    Problem Statement There are N positive integers written on a blackboard: A_1, ..., A_N .  Snuke can perform the following operation when all integers on the blackboard are even:   Replace each integer X on the blackboard by X divided by 2 .   Find the maximum possible number of operations that Snuke can perform.      Constraints  1 \leq N \leq 200  1 \leq A_i \leq 10^9         Input Input is given from Standard Input in the following format:  N  A_1  A_2 ... A_N       Output Print the maximum possible number of operations that Snuke can perform.        Sample Input 1 3
8 12 40      Sample Output 1 2  Initially, [8, 12, 40] are written on the blackboard.
Since all those integers are even, Snuke can perform the operation.  After the operation is performed once, [4, 6, 20] are written on the blackboard.
Since all those integers are again even, he can perform the operation.  After the operation is performed twice, [2, 3, 10] are written on the blackboard.
Now, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.  Thus, Snuke can perform the operation at most twice.       Sample Input 2 4
5 6 8 10      Sample Output 2 0  Since there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.       Sample Input 3 6
382253568 723152896 37802240 379425024 404894720 471526144      Sample Output 3 8

Solution (Python):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys


import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
A = np.array(readline().split(), dtype=np.int64)

ans=0
while np.all(A%2==0):
    A//=2
    ans+=1
print(ans)

Solution (Python):
import numpy as np
input()
x = np.array(input().split(),dtype=np.int32)
 
answer = 0
while np.all(x%2==0):
  x //= 2
  answer += 1
print(answer)

Solution (Python):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


def num(n):
    cnt = 0
    while n:
        if n % 2 == 0:
            cnt += 1
            n /= 2
        else:
            break
    return cnt


N, *A = map(int, read().decode('utf8').split())

ans = num(A[0])
for i in A:
    ans =min(ans, num(i))
print(ans)

Solution (Python):
def check_odd(li):
    for i in li:
        if i % 2 != 0:
            return False
    return True


N = int(input())
A = [int(x) for x in input().split()]

ans = 0

while 1:
    if check_odd(A):
        A = list(map(lambda x: x / 2, A))
        ans += 1
    else:
        break
print(ans)

Solution (Python):
input()
a=list(map(int,input().split()))
ans=0
while all(i%2==0 for i in a):
  a = [i/2 for i in a]
  ans += 1
print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
answer = 0
while True:
    for i in range(N):
        if A[i] % 2 != 0:
            print(answer)
            exit()
        A[i] //= 2
    answer += 1

Solution (Python):
n = int(input())
A = [int(i) for i in input().split()]
count = 0
while all(a%2==0 for a in A):
    A = [a//2 for a in A]
    count +=1
print(count)

Solution (Python):
N=int(input())
li= list(map(int,input().split())) 	
Ans=30
ans=0

for i in range(N):
	if li[i]%2==1:
		Ans=0
		break
	else:
		n=li[i]
		ans=0
		while n%2==0:
			n=n/2
			ans= ans+1
		if Ans>ans:
			Ans =ans

print(Ans)

Solution (Python):
def solve(n, A):
    for i in range(1, 30):
        tmp = 2 ** i
        for a in A:
            if a % tmp != 0:
                return i - 1
    return 29

_n = int(input())
_A = list(map(int, input().split()))
print(solve(_n, _A))

Solution (Python):
n = int(input())
A = list(map(int, input().split()))
count = 0
while all(a%2==0 for a in A):
    A = [a/2 for a in A]
    count+=1
print(count)

Solution (Python):

n = int(input())
a = list(map(int,input().split()))
ans = 0
while True:
    if sum([a[i]%(2**(ans+1)) for i in range(n)]) == 0:
        ans += 1
    else: break
print(ans)

Solution (Python):
import numpy as np
n = int(input())
count = 0
val_list = np.array(list(map(int, input().split())))

while True:
    
    even_cnt = len(list(filter(lambda x:x % 2 == 0, val_list)))
    
    
    if n == even_cnt:
        
        val_list = val_list/2
        
        count += 1
    else:
        break
print(count)

Solution (Python):
input()
l = list(map(int, input().split()))
count = 0
while all(i % 2 == 0 for i in l):
    l = [j / 2 for j in l]
    count += 1
print(count)

Solution (Python):
N = int(input())
Alist = list(map(int, input().split()))


def two(n):
    ans = 0
    while n % 2 == 0:
        n //= 2
        ans += 1
    return ans


print(min([two(a) for a in Alist]))

Solution (Python):
input()
a=list(map(int, input().split())) 
count=0
while all(x%2==0 for x in a):
    a=[x/2 for x in a]
    count+=1
print(count)

Solution (Python):
input()
A=list(map(int,input().split()))
count=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count+=1
print(count)

Solution (Python):



def input_one_number():
    return int(input())


def input_multiple_number():
    return map(int, input().split())


def input_multiple_number_as_list():
    return list(map(int, input().split()))


def input_map():
    return [list(map(int,list(input()))) for i in range(h)]


def print_list(list):
    print(*list)
    return


def print_map(maplist):
    for i in maplist:print(*i, sep='')
    return


def generate_primenums():
    n = 100
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5+1)):
        primes.difference_update(range(i*2, n+1, i))
    primes=list(primes)
    return primes

def memo():
    a=[0]*5
    b=a  
    b2=a[:]  
    a[1]=3
    print('b:{}, b2:{}'.format(b,b2))  
    
    import copy
    a= [[0]*3 for i in range(5)] 
    b=copy.deepcopy(a)  
    
    
    odd=[i for i in range(100) if i%2==1] 
    
    
    import bisect
    a = [1, 2, 3, 5, 6, 7, 8, 9]
    b=bisect.bisect_left(a, 8)
    
    
    from itertools import permutations, combinations,combinations_with_replacement,product
    a=['a','b','C']
    print(list(permutations(a)))
    print(list(combinations(a,2)))
    print(list(combinations_with_replacement(a,3)))



def kaijo(n):
    import math
    return math.factorial(n)


def num_combination(n,r):
    import math
    return math.factorial(n) // math.factorial(n - r)



def calc_gcd_lcm(a,b):
    import fractions
    GCD=fractions.gcd(a,b)
    lcm=a*b//gcd
    return gcd,lcm


def calc_gcd_list(l):
    import numpy as np
    return np.gcd.reduce(l)

N = input_one_number()
lst_A = input_multiple_number_as_list()

min = 1000000000

for i in range(N):
    cnt = 0
    a = lst_A[i]
    while a % 2 == 0:
        cnt +=1
        a //= 2
    if min > cnt:
        min = cnt
print(min)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
 
res = True
cnt = 0
 
while res:
    for i in range(n):
        if a[i]%2 != 0:
            res = False
            break
 
        a[i] = a[i]/2
 
    if res:
        cnt += 1
 
print(cnt)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

res = True
cnt = 0

while res:
    for i in range(n):
        if a[i]%2 != 0:
            res = False
            break

        a[i] = a[i]/2

    if not res:
        break

    cnt += 1

print(cnt)

Solution (Python):
def calc(c, cnt):
    r = [i % 2 for i in c]
    if sum(r) > 0:
        print(cnt)
        return 1
    else:
        for k, num in enumerate(c):
            c[k] = num / 2
        cnt += 1
        if calc(c, cnt) == 1:
            return 1
        

N = int(input())
c = [int(i) for i in input().rstrip().split(' ')]
calc(c, 0)

Solution (Python):

N = int(input())
A = [int(i) for i in input().split()]

ans = []
for i in range(N):
    count = 0
    while True:
        if A[i] % 2 != 0:
            ans.append(count)
            break
        else:
            A[i] /= 2
            count += 1
print(min(ans))

Solution (Python):
n = input()
a = list(map(int, input().split()))
even = True
count = 0
while even:
    for ai in range(len(a)):
        if a[ai] % 2 != 0:
            even = False
            break

    if even:
        a = list(map(lambda num: num / 2, a))
        count += 1
    else:
        break
print(count)

Solution (Python):
import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))


count=0
cont=1




while cont :
  a_ = np.unique(a % 2)
  if a_[0]==0 and len(a_) == 1 :
    count += 1
  else :
    break

  a = a / 2

print(count)

Solution (Python):
n = int(input())
lis = list(map(int, input().split()))
odd_flag = 0

ans = 0

while odd_flag == 0:
    count = 0
    for i in range(0, n):
        if lis[i] % 2 == 0:
            lis[i] = lis[i]/2
            count += 1
        else:
            odd_flag = 1
    if count == n:
        ans += 1

print(ans)

Solution (Python):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Solution (Python):
N = int(input())
list = list(map(int, input().split()))
count=0
while all(i%2 == 0 for i in list):
    count+=1
    list=[j/2 for j in list]
print(count)

Solution (Python):
from functools import reduce
from operator import mul

N = int(input())
A = [int(i) for i in input().split()]
L = 0

while reduce(mul, [i+1 for i in A]) % 2 == 1:
    A = [int(i/2) for i in A]
    L += 1

print(L)

Solution (Python):
N= int(input())
alist=[int(i) for i in input().split()]
ans=0

while True:
    if [i for i in alist if i%2==1]:
        break
    alist = [i//2 for i in alist]
    ans+=1
print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
ans = 0

while all(map(lambda x: x % 2 == 0, A)):
    A = list(map(lambda x: x // 2, A))
    ans += 1

print(ans)

Solution (Python):
import numpy as np
N = int(input())
A = np.array(list(map(int,input().split())))
cnt = 0
while True:
    if all(x%2==0 for x in A):
        A = A//2
        cnt += 1
    else:
        print(cnt)
        break

Solution (Python):

import numpy as np

N = int(input())

line = np.array(list(map(int, input().split())))

num = 0
while True:
    l = np.mod(line, 2)
    if 1 in l:
        print(num)
        break
    else:
        num += 1
        line = line / 2

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
mod = [0]*n
check = 0
    
for ii in range(1000):
    for i in range(n):
        mod[i] = a[i] % 2
        check = check + mod[i]
        a[i] = a[i]/2
    if (check>=1):
        print(ii)
        break

Solution (Python):
N = input()
A = list(map(int, input().split()))
cnt = 0
while all(a%2==0 for a in A):
    A = [a/2 for a in A]
    cnt += 1
print(cnt)

Solution (Python):
import numpy as np
n=int(input())
a=list(map(int,input().split()))
arr=np.array(a)

count=0
f=0

while 1:
    for i in arr:
        if i%2==1:
            f=f+1
    if f==0:
        arr=arr//2
        count+=1
        f=0
    else:
        break
print(count)

Solution (Python):


import math


def solve(N, Ai):
    answer = int(math.log2(10**9)) + 1
    eachCounter = [0] * N
    for j in range(0, N):
        counter = 0
        while True:
            if Ai[j] % 2 == 0:
                counter = counter + 1
                Ai[j] = Ai[j] / 2
            else:
                break
        eachCounter[j] = counter
    for j in range(0, N):
        if eachCounter[j] < answer:
            answer = eachCounter[j]

    return answer


if __name__ == "__main__":
    N = int(input())
    Ai = list(map(int, input().split(' ')))
    print(solve(N, Ai))

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
cnt = 0

while True:
    for i in range(n):
        if a[i] % 2 == 0:
            a[i] /= 2
        else:
            break
    else:
        cnt += 1
        continue
    break

print(cnt)

Solution (Python):
import sys
n=int(input())
a=list(map(int,input().split()))
ans=0
while True:
    for i in range(n):
        if a[i] %2 !=0:
            print(ans)
            sys.exit()
        else:
            a[i]=a[i]//2
    ans+=1

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
num=0
for i in range(100):
    for j in range(n):
        if l[j]%2==0:
            num+=1
            l[j]=l[j]/2
        else:
            break
print(num//n)

Solution (Python):
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())), np.int32)

ans = 0
while True:
    flg = 0
    for a in A:
        if a % 2 != 0:
            flg = 1
            break
    if flg:
        break
    else:
        A = A/2
        ans += 1
print(ans)

Solution (Python):
def time(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans
N = int(input())
LA = list(map(int, input().split()))
ans = min(map(time, LA))
print(ans)

Solution (Python):
from functools import reduce
from itertools import count

input()
print(min(map(lambda e: filter(lambda i: e % (2 ** i) != 0, count(0, 1)).__next__() - 1, map(int, input().split()))))

Solution (Python):
input()
a = list(map(int, input().split()))
count = 0
while all(i%2 == 0 for i in a):
  a = [i // 2 for i in a]
  count += 1
print(count)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
res = 0
for i in range(N):
    while True:
        exist_odd = False
        for j in range(N):
            if A[j] % 2 != 0:
                exist_odd = True

        if exist_odd:
            break

        for k in range(N):
            A[k] /= 2

        res += 1

print(res)

Solution (Python):
n = int(input())
a = []
counter = 0
a = input().split()
success_result = [0] * n
while True:
    for index, item in enumerate(a):
        if int(item) % 2 == 0:
            a[index] = int(item) / 2
            success_result[index] = True
        else:
            continue
    if all(success_result):
        counter += 1
        success_result = [None for _ in range(n)]
    else:
        break
print(counter)

Solution (Python):


import sys


def solver(allNumber, eachNum, useRange):
    answer = sys.maxsize
    counter = [0]*allNumber
    for j in useRange:
        while True:
            if eachNum[j] % 2 == 0:
                counter[j] = counter[j] + 1
                eachNum[j] = eachNum[j] / 2
            else:
                break

    for j in useRange:
        if counter[j] <= answer:
            answer = counter[j]
    return answer


if __name__ == "__main__":
    N = int(input())
    Ai = list(map(int, input().split(' ')))
    print(solver(N, Ai, range(0, N)))

Solution (Python):
num_input=int(input())
vals=[int(str1) for str1 in input().split()]
counter=0


while True:
    if sum([1 for val in vals if val%2==0])==num_input:
        vals=[val/2 for val in vals]
        
        counter+=1
    else:
        break
print(counter)

Solution (Python):
count = int(input())
ns = []*count
ns = input().split()
numcnt = 0
divcnt = [0]*count

for i in ns:
    num = int(i)
    while num%2 == 0:
        num = num/2
        divcnt[numcnt] += 1
    numcnt += 1
print(min(divcnt))

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
l=len(a)

num=0
while True:
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]/2
        else:
            print(num)
            exit()
    num+=1

Solution (Python):


import sys


def solve(allNumber,eachNum):
    answer = 0
    counter = [0]*allNumber
    for j in range(len(eachNum)):
        cnt = 0
        while eachNum[j] % 2 == 0:
            counter[j] = counter[j] + 1
            eachNum[j] = eachNum[j] / 2






    answer = sys.maxsize
    for j in range(0, allNumber):
        if counter[j] <= answer:
            answer = counter[j]
    return answer

if __name__ == "__main__":
    input=sys.stdin.readline
    N = list(map(int, input().split()))
    Ai = list(map(int, input().split()))
    print(solve(N[0], Ai))

Solution (Python):
n = input()
nList = list(map(int,input().split()))
count = 0
while True:
  for i in range(len(nList)):
    nList[i] = nList[i]/2
    if not(nList[i].is_integer()):
      print(count)
      exit()
  count += 1

Solution (Python):
input()
A=list(map(int,input().split()))
count=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count+=1
print(count)

Solution (Python):
input()
List=list(map(int,input().split()))
ans=0
while all(l%2==0 for l in List):
  List=[l/2 for l in List]
  ans+=1
print(ans)

Solution (Python):
input()
A=list(map(int,input().split()))
ans=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)

Solution (Python):
def divisible(n):
  ans = 0
  while n%2 == 0:
    n /= 2
    ans +=1
  return ans

n = int(input())
a = map(int,input().split())

ans = min(map(divisible,a))

print(ans)

Solution (Python):
input()
A = list(map(int, input().split()))
print(min(len(bin(a&-a))-3 for a in A))

Solution (Python):
import numpy as np

N = int(input())

lis = np.array(list(map(int, input().split())))

count = 0
while(1):
  if np.mod(lis, 2).sum() != 0:
    print(count)
    break
  else:
    lis = lis // 2
  count = count + 1

Solution (Python):
N=int(input())
A=list(map(int, input().split()))
count=0
tmp=A
flag=True
while flag:
  for i in range(N):
    if tmp[i]%2!=0:
      flag=False
      break
  if flag:
    tmp = list(map(lambda x: x / 2, tmp))
    count+=1
print(count)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))

ans=0
while True:
    repeat=True
    for i in range(n):
        if a[i]%2==0:
            a[i]//=2
        else:
            repeat=False
            break
    if repeat==True:
        ans+=1
    else:
        break
print(ans)

Solution (Python):
n = int(input())
ais = input().split()
t = []
for a in ais:
  m = 0
  a = int(a)
  while a % 2 == 0:
    m += 1
    a = a / 2
  t.append(m)
print(min(t))

Solution (Python):
def times_divisible(n):
    ans = 0 
    while n%2 ==0:
        n/=2
        ans +=1
    return ans
n= int(input())
A=[int(a) for a in input().split()]
ans = min(times_divisible(a) for a in A)
print(ans)

Solution (Python):
n = input()
A = list(map(int, input().split()))
ans = 0
while not any (a%2 for a in A):
    ans+=1
    A = [a/2 for a in A]
print(ans)

Solution (Python):
n = int(input())
li = list(map(int, input().split()))
cnt = 0
for _ in range(10**9):
    if all(x%2==0 for x in li):
        cnt += 1
        li = list(map(lambda x: (x+1)//2, li))
    else:
        break
print(cnt)

Solution (Python):
n = int(input())
lista = list(map(int, input().split()))

m = 0
l = 2

while True:
  for a in lista:
    if a % l == 0:
      continue
    else:
      print(m)
      exit()
  else:
    m += 1
    l *= 2

Solution (Python):
N = int(input())
list = [int(x)  for x in input().split()]
ans = float('inf')
for a in list:
    ans = min(ans, len(bin(a))-bin(a).rfind('1')-1 )
print(ans)

Solution (Python):
import numpy as np
N = input()
count = 0

data=np.array(input().split(),dtype=np.int64)

while(data%2==0).all():
    data //= 2
    count += 1
    
print(count)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

for k in range(32):
  for i in range(N):
    if A[i] % 2 == 0:
      A[i] //= 2
    else:
      print(k)
      exit()

Solution (Python):


def main():
    unko_ans = 0
    is_unko = True
    unko_n = int(input())
    unko_a = list(map(int, input().split()))
    while is_unko:
        for j in range(len(unko_a)):
            if unko_a[j] % 2 == 0:
                unko_a[j] = unko_a[j] / 2
            else:
                is_unko = False
                print(unko_ans)
                break
        unko_ans = unko_ans + 1
if __name__ == "__main__":
    main()

Solution (Python):


import numpy as np

input()
a=np.array(input().split(),dtype=np.int64)
ans=0

while(a%2==0).all():
    a//=2
    ans+=1
print(ans)

Solution (Python):


import numpy as np

n=int(input())
a=[int(k) for k in input().split()]
ans=0
for _ in range(100):
    for i in range(n):
        if(a[i]%2==1):
            print(ans)
            exit(0)
        a[i]//=2
    ans+=1

Solution (Python):
import sys

if __name__ == "__main__":
    args = sys.stdin.read().split()
    N, A = int(args[0]), list(map(int, args[1:]))  

    cnt = 0
    while True:
        if any(map(lambda x: x % 2 == 1, A)):    
            break

        cnt += 1
        A = list(map(lambda x: x / 2, A))

    print(cnt)

Solution (Python):
n = input()
nList = list(map(int,input().split()))

count = 0
while True:
  for i in range(len(nList)):
    nList[i] = nList[i]/2
    if not(nList[i].is_integer()):
      print(count)
      exit(0)
  count += 1

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

cnt = 0
while True:
    if sum(list(1 for x in a if x % 2 == 1)) != 0:
        print(cnt)
        exit()  
    a = list(x // 2 for x in a)
    cnt += 1
print(cnt)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
ans=30
for i in a:
  for j in range(30):
    if i&(1<<j):
      if j<ans:
        ans=j
      break
print(ans)

Solution (Python):

"""AtCoder Beginner Contest 081: B - Shift only
https://atcoder.jp/contests/abc081/tasks/abc081_b
"""

__author__ = 'bugttle <bugttle@gmail.com>'


def are_evens(array):
    for x in array:
        if x % 2 != 0:
            return False
    return True


def main():
    N = int(input())
    As = list(map(int, input().split()))

    count = 0
    while are_evens(As):
        As = [int(a/2) for a in As]
        count += 1
    print(count)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

A = list(map(int,input().split()))

con = 0

while all(i % 2 == 0 for i in A):
  A = list(map(lambda x: int(x / 2), A))
  con += 1

print(con)

Solution (Python):
import numpy as np

n = input()
a = list(map(int, input().split()))
cnt=0
cnt_list = np.zeros(int(n))
for i in range(len(a)):
    while a[i]%2 == 0:
        cnt+=1
        a[i] = a[i]/2
    cnt_list[i]=cnt
    cnt=0


print(int(min(cnt_list)))

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

cnt = 0
for i in range(100):

    if sum(list(1 for x in a if x % 2 == 1)) != 0:
        print(cnt)
        exit()
    
    a = list(x // 2 for x in a)
    cnt += 1

print(cnt)

Solution (Python):

n=input()
ans=0
i=0
b=list(map(int,input().split()))

end=True
while end:
    for x in b:
        if x%2!=0:
            print(ans)
            end=False
            break
    b=list(map(lambda x:x/2,b))
    ans+=1

Solution (Python):
iterate = 0
n = int(input())
num_list = input().split()
flag = 0
while True:
  i = 0
  while i <= n-1:
    if int(num_list[i])%2 == 1:
      flag = 1
      break
    num_list[i] = int(num_list[i])/2
    i += 1
  if flag == 1:
    break
  iterate += 1

print(iterate)

Solution (Python):
iterate = 0
n = int(input())
num_list = input().split()
flag = 0
while True:
  i = 0
  while i <= n-1:
    if int(num_list[i])%2 == 1:
      flag = 1
      break
    num_list[i] = int(num_list[i])/2
    i += 1
  if flag == 1:
    break
  iterate += 1

print(iterate)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    a = LI()
    ans = float("inf")
    for i in a:
        k = 0
        while not i&1:
            i >>= 1
            k += 1
        if ans > k:
            ans = k
    print(ans)
    return


if __name__ == "__main__":
    solve()

Solution (Python):
n = int(input())
al = list(map(int, input().split()))

count = [0]*n

for i in range(n):
    a = al[i]
    for _ in range(30):
        if a%2 == 0:
            a = a/2
            count[i] += 1
        else:
            break

print(min(count))

Solution (Python):
N = int(input())
As = [int(i) for i in input().split()]

ans = 0
while all([a % 2 == 0 for a in As]):
    As = [a // 2 for a in As]
    ans += 1

print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
count = 0
tf =True
while tf:
    for i in range(0, len(A)):
        if A[i] % 2 ==1:
            tf = False
        A[i] = A[i]/2
    if not tf:
        break
    count += 1
print(count)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
count = 0

tf = True

while tf:
    for i in range(0, len(A)):
        if A[i] % 2 == 1:
            tf = False
        A[i] = A[i] / 2
    if not tf:
        break
    count += 1
print(count)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
n = 0

even = True
while even:
  for i in range(N):
    b = list(map(lambda x: x % 2 == 0, a))
    if False in b:
      even = False
      break
    a = list(map(lambda  x: int(x/2), a))
    n += 1

print(n)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))

count = 0

while True:
    
    odd_cnt = 0
    for i in range(N):
        if a[i] % 2 == 1:
            odd_cnt += 1
        a[i] = a[i] / 2
    
    
    if odd_cnt > 0:
        break
    else:
        count += 1

print(count)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

k = 0
ans = 0
while k == 0:
	for i in range(n):
		if a[i] % 2 == 0:
			a[i] = int(a[i] / 2)
		else:
			k = 1
			break
	ans += 1


print(ans-1)

Solution (Python):
def main():
    N = int(input())
    nums = list(map(int, input().split()))

    count = 0
    flag = True

    while(flag):
        for num in nums:
            if num % 2 == 0:
                continue
            else:
                flag = False
                break
        nums = [n/2 for n in nums]
        count += 1

    print(count-1)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

for i in range(1, max(A)):
  if not all(list(map(lambda x: x % 2**i == 0, A))):
    print(i - 1)
    break

Solution (Python):
n = int(input())
a = [int(x) for x in input().split()]

count = 0
while(1):
   check = [x % 2 for x in a]
   if (sum(check) == 0):
      count += 1
      a = [x/2 for x in a]
   else:
      break

print(count)

Solution (Python):
n=int(input())
listA=list(map(int, input().split()))
count=0
while all(a%2==0 for a in listA):
    listA=[a/2 for a in listA]
    count +=1
print(count)

Solution (Python):
count = 0
n = int(input())
lst = list(map(int, input().split()))
while all(i%2 == 0 for i in lst):
  lst = [i // 2 for i in lst]
  count += 1
print(count)

Solution (Python):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Solution (Python):
n = int(input())
listA = list(map(int, input().split()))
count = 0
isBroken = False


while True:
    for i in range(n):
        if listA[i] % 2 == 0:
            listA[i] //= 2
        else:
          isBroken = True
          break
    if isBroken:
        break
    else:
        count += 1


print(count)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
count = 0

while all(a%2 == 0 for a in A):
    A = [a / 2 for a in A]
    count += 1

print(count)

Solution (Python):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
  ans = min(ans, len(bin(i)) - bin(i).rfind("1")-1)
print(round(ans))

Solution (Python):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Solution (Python):
N = int(input())
A = list(map(int,input().split()))

step = 0
while True:
    flag = False
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            flag = True
            break
    if flag:
        break
    step += 1
print(step)

Solution (Python):
n=int(input())
a = list(map(int, input().rstrip().split()))

flag=1
c=0
while flag==1:
  for i in range(0,n):
    if a[i]%2!=0:
      flag=0
      break
  if flag==1:
    c+=1
    for j in range(0,n):
      a[j]//=2
print(c)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
count = 0
flag = 0
while True:
	for i in range(n):
		A[i] /= 2
		if (A[i] % 2 != 0) or (A[i] == 0):
			flag += 1;
			break
	if flag is 1:
		break
	count += 1
if count is 0:
	print(count)
else:
	print(count+1)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
ans=99999999999999999
for ai in a:
    c=0
    while(ai%2==0):
        ai//=2
        c+=1

    if(ans>c):
        ans=c
print(ans)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

count = 0
while(True):
    b = list(map(lambda x: x%2 != 0, A))
    if True in b:
        break

    A = list(map(lambda x: x/2, A))
    count += 1
    
print(count)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

count = 0
even_bool = True
while(even_bool):
    b = list(map(lambda x: x%2 != 0, A))
    if True in b:
        even_bool = False
        break

    A = list(map(lambda x: int(x/2), A))
    count += 1
    
print(count)

Solution (Python):
K = input()
T = list(map(int,input().split()))

def main():
    count = 0
    flg = 1
    while(flg):
        for i in range(len(T)):
            if T[i] % 2 == 0:
                T[i] = T[i]/2
            else:
                flg = 0
                break
        count +=1
    print(count-1)
    
if __name__ == "__main__":
    main()

Solution (Python):


N=int(input())
L=input().split()
L = [int(s) for s in L]
n=0
tem=0


for i in range(1000000000):

    for j in L:
        
        tem+=j%2
    

    if tem!=0:
        break
    else:
        for k in range(len(L)):
            L[k]=L[k]/2
        n+=1
    


print(n)

Solution (Python):

def division(array, base, num):
    for i in range(num):
        if array[i] % base != 0:
            return False
    return True


num = int(input())
array = list(map(int, input().split()))

count = 0
base = 2
while division(array, base, num):
    base *= 2
    count += 1

print(count)

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
for i in range(n):
    b=bin(A[i])
    A[i]=len(b)-b.rfind('1')-1
print(min(A))

Solution (Python):
N = int(input())
A = input().split()
count = 0
count_min = 0
for i in range(N):
    count = 0
    Ai = int(A[i])
    if Ai % 2 != 0:
        count_min = 0
        break
    while Ai % 2 == 0:
        count += 1
        Ai = Ai / 2
    if count_min == 0:
        count_min = count
    elif count_min > count:
        count_min = count

print(count_min)

Solution (Python):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Solution (Python):
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ans = 0

while True:
  for i in range(n):
    if a[i]%2 != 0:
      print(ans)
      exit()
    else:
      a[i] = a[i]/2
  ans += 1

Solution (Python):
n = int(input())
arr = [int(i) for i in input().split(" ")]
allOdd = True
count = 0
while allOdd:
  for i in arr:
    if i % 2 == 1:
      allOdd = False
      break
  else:
    arr = [x/2 for x in arr]
    count += 1
  
print(count)