You might have heard of the Josephus problem, where Josephus and $$$N - 1$$$ other soldiers arranged themselves in a circle and killed each other. Fast forward to the end, Josephus was the only person surviving. "Things would have been different if I proposed another rule," he thought.
Therefore, Josephus decided to time-travel back to 67 C.E. and proposed the following rule instead:
$$$N$$$ soldiers, including Josephus himself, arrange themselves in a circle. The soldiers are numbered from $$$1$$$ to $$$N$$$ clockwise. Soldier 1 holds two knives initially, one of which is labelled L (left) and the other is labelled R (right). The following process is then repeated:
The process ends when there is only one soldier alive, or when no alive soldiers are holding a knife. All the soldiers who are still alive will be surviving in the battle.
Josephus wants to find the number of surviving soldiers after this process. Can you help him?
The first and only line of input consists of a single integer $$$N$$$ ($$$2 \leq N \leq 10^{18}$$$), the number of soldiers.
Output a single integer: The number of surviving soldiers after this process.
5
1
4
1
When $$$N = 5$$$, the process proceeds as follows:
When $$$N = 4$$$, the process proceeds as follows:
| Name |
|---|


