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())
num_list = list(map(int, input().split()))

ans = 10^10

for i in num_list:
  div_num = 0
  while i % 2 == 0:
    i  //= 2
    div_num + 1  
    
  if ans > div_num:
    ans = div_num

print(ans)
N = int(input())
num_list = list(map(int, input().split()))
 
ans = 10**10
 
for i in num_list:
  div_num = 0
  while i % 2 == 0:
    i  //= 2
    div_num += 1  
    
  if ans > div_num:
     ans = div_num
print(ans)
