Delete

Program time limit: 1 second

Program memory limit: 512 MB

Aaron loves arrays for their fast lookup speed. When he is bored, he chooses a positive integer $n$, and puts all the positive integers up to $n$ in order into an array. He then removes half the numbers from the array, and reindexes the array so that there are no gaps. He repeats this until he is left with one number. Recently, Aaron has been trying to convince Eve to join his hobby. However, Eve loves her even numbers too much, so every turn she will only remove every number at an odd position. Unfortunately, Eve is not particularly impressed with Aaron's antics, and doesn't want to waste any more time doing this by hand. She enlists your help to find the final result whenever Aaron forces her to take part in this mentally exhilarating activity.

Input

The first and only line of input contains one integer $n$.

You should read from standard input.

In Python, you could use the line n = int(input()).

In C or C++, you could use the line long long int n; scanf("%lld", &n);.

Constraints

For all test cases:

  • $1 \le B_i \le 10^{18}$ for all $i$.

Output

Output a single integer, the last integer remaining at the end of the process.

You should write to standard output.

In Python, you could use the line print(answer).

In C or C++, you could use the line printf("%lld\n", answer);.

Sample Input 1

7

Sample Output 1

4

Explanation 1

1 2 3 4 5 6 7
1 2 3 4 5 6 7
2 4 6
2 4 6
4

Scoring

Your program will be run on the 1 sample case and multiple secret test cases one after another, and if it produces the correct output for all test cases, it solves the task. Recall that your final score on the task is the score of your highest scoring submission.


Submit

Log in to submit!

Past submissions

You haven't submitted to this task.