Arey fisal gaya !!!

0

0 votes
Problem

Monkey Kumar slipped on banana peels and got trapped in a pit.
He has to get out using the stairs which has N steps.
In one move, he jumps three steps upwards and falls one step downwards. He does not fall once he is out of the pit.

Monkey Kumar is at step 0 initially.

Help Monkey Kumar calculate the number of steps in which he will get out of the pit.

INPUT:
A single integer N, the number of steps.

OUTPUT:
A single integer, the number of moves in which Monkey Kumar will get out.

CONSTRAINTS:
1N109 
 

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In the first move, Monkey Kumar goes upto 3rd step and then slips to 2nd step.
Clearly, in the next move, he can get out of the pit.

So, the total number of moves needed is 2.

Editor Image

?