Big difference#5718

Big difference

1 secundă
128 de megabyți
Mediu

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?

Date de intrare

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

Date de ieșire

One number — the "big difference".

Exemple

Exemplul 1

Loading
Loading

Exemplul 2

Loading
Loading

Exemplul 3

Loading
Loading