Given a positive integer , calculate the difference between the maximum and minimum values obtained by permuting the bits of this number, from the least significant bit to the most significant bit. For instance, consider the number , which has a binary representation of 10110_2. The maximum value from permutations of these bits is 11100_2 = 28, and the minimum value is 00111_2 = 7. Therefore, the difference is .
The first line of the input contains the number (0 < N \leq 10^{18}).
Output a single line with the result of the calculation.
Example 1
Example 2
Example 3