eolymp
bolt
Try our new interface for solving problems
Problems

Big difference

Big difference

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

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

Input

One positive integer n (1n2·10^9`).

Output

One number - the "big difference".

Time limit 1 second
Memory limit 128 MiB
Input example #1
19
Output example #1
21
Input example #2
1
Output example #2
0
Input example #3
1024
Output example #3
1023
Author Anatoliy Prisyazhnuk
Source 2-й этап Всеукраинской олимпиады по информатике 2013-2014 уч.г. 9 кл. г. Бердичев