Little Liesbeth likes to play with strings. Initially she got a string of length n, consisting of letters 'a' only.
Then Liesbeth performs next operations with the string:
Liesbeth stops when she has the string of length 1. For example, if n = 4, she needs 6 operations :

Liesbeth found that for some n number of operations is too big, and its hard to understand if the process is finite. So she asked You to write the program to help her.
First line of the input contains one integer n (2 ≤ n ≤ 106) — length of the initial string.
Print one integer — number of operations needed to obtain string of length 1. If process is infinite, print - 1 instead.
4
6
3
24
| Name |
|---|


