Crystal (Unknown)
Medium
Execution time limit is 0.2 seconds
Runtime memory usage limit is 64 megabytes
The precious stone Anknown has a unique crystal lattice that allows it to be split into either eight or twelve pieces in a single break. For jewelry crafting, you need exactly N parts. Determine the minimum number of breaks required to achieve this from a single crystal.
Input
The input consists of a single integer N (1 ≤ N ≤ 1,000,000), representing the number of parts needed.
Output
Output the minimum number of breaks required. If it is impossible to obtain exactly N parts, output -1.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 1K
Acceptance rate 10%