CSES - Aalto Competitive Programming 2024 - wk12 - Wed - Counter
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You have a counter that initially shows the number 0. In one move you can either increase the counter by 11 or decrease it by 2, but the counter can never be less than 0 or more than x. Find the minimum amount of moves you need in order to make the counter show x or report that the task is impossible.

Input

The first line contains the integer x.

Output

Print the minimum number of moves required to make the counter show x or -1 if the task is impossible.

Constraints

  • 0 \leq x \leq 10^6

Example 1

Input:

62

Output:

8

Example 2

Input:

1

Output:

-1

Example 3

Input:

0

Output:

0