Big difference#5718

Big difference

1 second
128 megabytes
Medium (≈1350)

Positive integer is given. You are allowed to make an infinite number of permutations of its significant bits, thus obtaining new numbers.

What is the greatest difference between two such numbers that can be obtained as a result of these operations?

Input

One positive integer , 1 \le n \le 2 \cdot 10^{9}.

Output

One number — the "big difference".

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading