Numeral System Base#6318

Numeral System Base

1 second
256 megabytes
Very easy

Given a natural number , find the smallest base of a numeral system such that can be represented as a one followed by zeros in this system (that is, N = K^m for some m \geq 1).

In other words, find the smallest such that when is written in base , it has the form .

Input

The input consists of a single line containing a natural number (2 \leq N \leq 10^9).

Output

The output should be a single line containing one natural number – the smallest base of the numeral system in which is represented as .

Examples

Example 1

Loading
Loading