Master of Lowbit
题号:NC237178
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Lowbit is a well-known operation which is widely used in Fenwick tree. The  of an integer x is the value of the lowest 1 in the binary representation of x.
For example,  6 equals to 2, since the binary representation of 6 is (110)_2, and (10)_2 is the value of the lowest 1 20 equals to 4, since the binary representation of 20 is (10100)_2, and (100)_2 is the value of the lowest 1
One day, Little Y wants to test your knowledge of and gives you one integer x. In each step, you can do one of the following operations to x:
You need find out the minimum number of steps to let x become 0.

输入描述:

One integer  -- the number Little Y gives you.

输出描述:

One integer indicating the minimum number of steps.
示例1

输入

复制
5

输出

复制
2
示例2

输入

复制
22

输出

复制
3

说明

For the second example, the 3 steps are:

22 \stackrel{+}{\longrightarrow} 24 \stackrel{-}{\longrightarrow}16 \stackrel{-}{\longrightarrow}0