A - Generous Eater
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.
Examples
Input
4
Output
3
Input
5
Output
4
Input
6
Output
4
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n ,l , x;
scanf("%lld",&n);
x = n / 3;
l = x * 2 + n % 3;
printf("%lld\n",l);
return 0;
}