Imperfect Square
Safari guide Saadan is marking out a rectangular observation area for his herd of Zebras. Obviously, squares are the optimal rectangles for this purpose, but Saadan has had it with perfectionism and perfect squares, so Saadan wants to make a rectangular observation zone with a given area with a very slightly imperfect square.
Specifically, Saadan knows his Zebras need metres squared of grass to graze healthity. Saadan wants to know if there exists a non-negative integer
such that
.
Can you let Saadan know if such an integer exists, and if so what one of them is? Otherwise, he might have to go back to the drawing board with his safari planning.
Input
The input consists of a single integer (
), the desired area of Saadan's zebra pen.
Output
Output a single non-negative integer satisfying
. If one doesn't exist, output
.
Example
Input 1
132
Output 1
11
Input 2
14
Output 2
-1
Input 3
4556
Output 3
67
Comments