Олимпиадный тренинг

Задача 38534. Another game of dice


Задача

Темы: Конструктив
Wushan decided to play with a six-sided die. Each of the six sides has an integer from 1 to 6, and the two numbers on opposite sides always add up to 7. Wushan first places the die on the table with a random side up, and then repeats the next operation. Rotate the die by 90 ° in one of the following directions: left, right, forward (the cube will move closer), and back (the cube will move further), then get y points, where y is the number written in side facing up.

For example, let's consider the situation where the side showing 1 is facing up, the near side is showing 5, and the right side is showing 4, as shown in the figure (original position for our example).

If the cube is turned to the right, as shown in the figure, the side showing 3 will be facing up. If the cube is rotated to the left from its original position, the side showing 4 will look up. The side showing 2 will be at the top if the cube is turned forward from its original position, and the side showing 5 will be facing up if the cube is rotated back from its original position.

Find the minimum number of operations Wushan must perform in order to score at least x points.

Input
The input is an integer x (\(1<=x<=10^{15}\)).

Imprint
Display the answer.
 

 

Examples
# Input Output
1 7 2
2 149696127901 27217477801