Lowbit is a well-known operation which is widely used in Fenwick tree. The

of an integer

is the value of the lowest

in the binary representation of

.
For example,

equals to

, since the binary representation of

is
_2)
, and
_2)
is the value of the lowest

.

equals to

, since the binary representation of

is
_2)
, and
_2)
is the value of the lowest

.
One day, Little Y wants to test your knowledge of

and gives you one integer

. In each step, you can do one of the following operations to

:
You need find out the minimum number of steps to let

become

.