E. Turnaround
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Given a number $$$N$$$ $$$(1 \le N \le 10^{18})$$$, find its binary representation without any leading zeros. Then, reverse the binary representation (i.e. $$$1011$$$ becomes $$$1101$$$). Print the base-10 number this reversed number represents.

Input

The first line has $$$N$$$ $$$(0 \le N \le 10^{18})$$$

Output

The decimal value of the reversed binary representation of $$$N$$$.

Examples
Input
5
Output
5
Input
731053868524
Output
238960798805