a = int(input())
b = int(input())
res = 0
while b != 0:
    c = a ^ b
    d = (a & b) << 1
    a = c
    b = d
    res += 1
print(res)