Initially, you have the number . In one step, it is allowed to either multiply the current number by (penalty ) or add to it (penalty ). Find the minimal total penalty to reach from . If it is not possible, print .
A single integer (1 \le N \le 10^9).
Print the minimal total penalty; print if it is not possible.
Example 1
Example 2
In the first example, the following steps are carried out to achieve the minimum penalty: