Sapsan
Time limit2sMemory limit512 MB
Given a row of n seats split into n/2 adjacent pairs, find the largest number of occupied seats so that exactly half the seated people sit next to an occupied neighbor.
- Level
Easy3 of 10
- Topics
- Math, Greedy, Combinatorics
- Solved
- No attempts yet
Statement
Lera often travels for work between Saint Petersburg and Moscow and back. Since her business is always urgent, she always takes the Sapsan to her destination. As is well known, each Sapsan car has exactly seats, namely rows of two seats each ( is even).
One day, on her way home after a business meeting, Lera had no neighbor, and she got bored. So she wondered: what is the maximum number of people that can be seated in a Sapsan car so that exactly half of the people have a neighbor? Help Lera answer this difficult question.
Input
The first and only line of the input file contains the number (), the number of seats in the Sapsan car. It is guaranteed that is even.
Output
In the only line of the output file, print the maximum number of people that can be seated in the car so that exactly half of them have a neighbor.
Note
The figure shows one possible arrangement of passengers in the example. The shaded cells correspond to occupied seats.
