Minimum Number Of Steps To Form N

easy
1. You are given a number N.
2. You have to find the minimum number of operations needed to to reach N from 0.
3. operations allowed are - 
   -> Double the number.
   -> Add one to the number.

Input Format

A number N

Output Format

Check the sample output and question video.

Constraints

1 <= arr[i] <= 10^6

Example

Input
10
Output
5
Previous
Minimum Number Of Steps To Reduce N
Next
Linear Equation Of N Variables

Related Questions