Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/bit-eng-kichik-bir

Lowest set bit

Easy 1000 ms 128 MB 23%
Share

A positive integer $n$ is given. What value does the rightmost bit equal to $1$ in its binary representation stand for? That is, if this bit is at position $k$ (from the right, starting from $0$), print $2^{k}$. For example, for $12 = 1100_{2}$ the answer is $4$.

Binary representation of a number: the rightmost set bit and its value are highlighted

Input

One positive integer $n$.

Output

One integer — $2^{k}$.

Note

$1 \le n \lt 2^{60}$

Examples

Input #1
12
Output #1
4
Input #2
7
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.