405950: GYM102191 A Generous Eater

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Generous Eatertime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

You have n candies. You want to give as much to your friends as possible, but you have a problem; every time you give two friends a candy each, you can't help but eat one yourself (if you have one left). You tried to resist after giving the first one, but after giving the second, it was unbearable.

What is the maximum number of friends you can give candies to?

Input

The first line of input contains n (1 ≤ n ≤ 109), the number of candies you have.

Output

Output a single line with the maximum number of friends you can give candies to.

ExamplesInput
4
Output
3
Input
5
Output
4
Input
6
Output
4

加入题单

上一题 下一题 算法标签: