def deep(a, b):
if a==b:
return 0
elif a>b:
return deep(int(a/2),int(b)) + 1
elif a<b:
return deep(int(a),int(b/2)) + 1
a, b = input().split(' ')
a = int(a)
b = int(b)
result = deep(a, b)
print(result)
알고리즘