A hardware register must be reconfigured from state a to state b (both given as non-negative integers, compared bit by bit in binary). Toggling a single bit from 0 to 1 draws a calibration pulse costing 1 unit of energy. Toggling a single bit from 1 to 0 requires a discharge cycle costing 2 units of energy. Bits where a and b already agree require no action.
Compute the minimum total energy needed to transform a into b.
Input format
Line 1: two space-separated integers a b.
Output format
A single integer: the minimum total energy cost.
Constraints
- 0 ≤ a, b ≤ 1,000,000,000