Walking
Time limit2sMemory limit2048 MB
Given X, compute the net forward distance after X alternating moves of 3 m forward (A) and 2 m backward (B), starting with A.
- Level
Easy1 of 10
- Topics
- Simulation, Math
- Solved
- No attempts yet
Problem
JOI is walking on a straight road.
JOI repeats the following two actions in alternating order: action A, action B, action A, and so on.
- Action A: move
3 mforward. - Action B: move
2 mbackward.
After performing action A and action B a total of X times, how many meters forward from the starting position has JOI moved?
Input
The input is given in the following format.
X
Output
Print the distance moved forward from the starting position in meters, without the unit (m).
Print nothing except the answer. (Do not print prompts such as a request for input.)
Constraints
1 ≦ X ≦ 100.
X is an integer.