2271 - 最小的x
Description

给定一个正整数n,求最小的正整数x,使得我们能找到整数y,满足y^2=n+x^2

因为OJ速度问题,n\leq 10^{10}

Input

输入数据一行,一个正整数n

Output

如果这样的存在x,输出最小的正整数x。 如果不存在这样的x,输出-1.


Examples

Input

3

Output

1

Input

2

Output

-1

Input

12345

Output

404
题目参数
Time Limit 1 second
Memory Limit 128 MB
提交次数 69
通过次数 8