Josh loves solving problems. However, solving problems takes a lot of time, so he will sometimes batch problems together, which allows him to solve them quicker. He will do it according to the following rules:
- Every 2 problems take him 1 minute to solve (rounded down).
- Every 7 problems take him 1 less minute to solve than usual.
Some examples:
- Solving
problems takes Josh minutes. It takes him minutes to solve the problems usually. However, since he's solved problems, and every problems take less minute, he will only take minutes. - Solving
problems takes Josh minutes in total. - Solving
problem takes Josh minutes.
Josh has only
Input Specification
The first line will contain the integer
Output Specification
Output the maximum number of problems Josh can solve in
Subtasks
Subtask 1 [37%]
Subtask 2 [63%]
No additional constraints.
Sample Input for Subtask 1
Copy
5
Sample Output for Subtask 1
Copy
15
Explanation for Sample for Subtask 1
Solving
Sample Input for Subtask 2
Copy
1000000007
Sample Output for Subtask 2
Copy
2800000021
Comments
technically, if one problem takes zero minutes, doesn't 1000000007 minutes give infinite?