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

for i in range(n):

	a_joined = a_joined | a[i]

print(len(bin(a_joined)) - 3)

n = int(input())
a = list(map(int, input().split()))
answer = 0

for i in a:
    answer = answer | i
print(len(bin(answer & -(answer))) - 3)