# Cheeky bus driver [duplicate]

The bus driver picks up the children from their homes every morning for school. All the homes are positioned around a circular street and the bus driver has to stop at every home exactly once.

One monday morning the bus driver decided to only pick up every second child he encountered along his way. However, he still had to pick up every single children, so this meant he was willing to go multiple rounds.

The houses are indexed from 1 to N (they come in order). The bus driver starts at the first (index 1) house and does not change directions during his trip. You must find the index of the house the last child is picked up from.

Input

A single positive number N read from the standard input representing the number of houses along the street.

Output

Output the index of the house the last child is picked up from to the standard output.

Example

Input: 10

Output: 4

The order of pickups are as follows: 1 3 5 7 9 2 6 10 8 4

Shortest code wins!

• Why the restrictive input/output? It is common to allow anonymous functions that take an argument as input and return a value as output, as well as STDIN and STDOUT. – sporklpony Apr 13 '17 at 15:08
• This is a special case of this challenge, but since this problem has a closed form solution for k = 2, it might be worth keeping this open separately. – Martin Ender Apr 13 '17 at 15:12
• @MartinEnder That makes it more of a dupe of this one, which is currently closed as a dupe of the other :/ – Geobits Apr 13 '17 at 15:18
• I guess it's also subtly different because this one counts out the first in each pair, not the second. – Martin Ender Apr 13 '17 at 15:18
• That's the same as the ninja challenge though. – Martin Ender Apr 13 '17 at 15:21