#GYM104669E. Turnaround

Turnaround

Description

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.

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

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

Input

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

Output

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

5
731053868524
5
238960798805