Products#8581

Products

1 second
128 megabytes
Medium

Let be a positive integer. George wrote a program which finds positive integers a_1, a_2, ..., a_k, whose product increases times if we add to each of them, i.e.

(a_1 + 1) \cdot (a_2 + 1) \cdot ... \cdot (a_k + 1) = n \cdot a_1 \cdot a_2 \cdot ... \cdot a_k

Now, however, he wants to find out what's the smallest value of , for which this is possible. Write a program which solves George's new task.

Input

Integer number (2 < n < 1000).

Output

Print the required value of .

Examples

Example 1

Loading
Loading