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.
N = int(input())
list = input().split()
list = [int(i) for i in list]
count_list = []
for i in list:
  count = 0
  while i % 2 ==0:
    count +=1
    i = i / 2
    count_list.append(count)
print(max(count_list)) 


N = int(input())
list = input().split()
list = [int(i) for i in list]
count_list = []
for i in list:
  count = 0
  while i % 2 ==0:
    count +=1
    i = i / 2
  count_list.append(count)
print(min(count_list)) 

