# -*- coding: utf-8 -*-



import numpy as np



n = int(eval(input()))

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



count = 0



while(1):

    if all(1 - (l % 2)):

        count += 1

        l = l / 2

    else:

        break



print(count)

N = eval(input())

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



count = 0

while all(a%2==0 for a in A):

    count += 1

    A = [a/2 for a in A]



print(count)

# -*- coding: utf-8 -*-
import numpy as np

n = int(eval(input()))
l = np.array(list(map(int, input().split())))
count = 0
while 1:
    if all(1 - (l % 2)):
        count += 1
        l = l / 2
    else:
        break
print(count)

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

-# -*- coding: utf-8 -*- -import numpy as np - -n = int(eval(input())) -l = np.array(list(map(int, input().split()))) +N = eval(input()) +A = list(map(int, input().split())) -while 1: -    if all(1 - (l % 2)): -        count += 1 -        l = l / 2 -    else: -        break +while all(a % 2 == 0 for a in A): +    count += 1 +    A = [a / 2 for a in A]