n = int(input())
nums = list(map(int, input().split()))

ods = 0
ans = 0
first = True
while ods != n:
    ods = 0
    div = 0
    for i in range(len(nums)):
        e = nums[i]
        if e % 2 == 0 and div < 1:
            nums[i] = e // 2
            first = False
            div += 1
        else:
            nums[i] *= 3
            ods += 1
    ans += 1
ans -= 1
print(ans)