One day Colin learned how to represent a number in binary form. For example, the binary form of
_%7B10%7D)
is
_%7B2%7D)
, and he was very excited!
Further, Eva taught Colin a well-known binary function
)
which represents the value of the bit corresponding to the lowest

of

in binary form. For example,
%20%3D%201)
,
Colin thought this function was amazing, so he thought of an interesting problem, and then it comes:
Given a binary form of a number
)
, you need to perform some operations on

.
Each turn you can choose one of the following two operations:
-
, which means adding the lowest bit of
to
-
, which means subtracting the lowest bit of
from
Now Colin wants to know, what is the minimum number of operations required to turn

into

?