Question
Finding Ideal Land Dimensions
After a lucky lottery win, Sam is on the hunt for the perfect piece of land to call his own. He dreams of owning a plot with an area exactly equal to A. However, Sam has a specific requirement: he wants the dimensions of the land - its length and breadth - to be as close as possible. Determined to find the best fit, Sam embarks on a quest to discover the dimensions that will yield the smallest absolute difference between length and breadth. Can you help Sam calculate this minimum difference?
Input
The first line of the input contains a single integer A.
Constraints
1 ≤ A ≤ 109
Constraints
1 ≤ A ≤ 109
Output
Output the minimum possible absolute difference.
Example
Sample Input
10
Sample Output
3
Explanation
We can have length = 2 and breadth = 5.
Sample Input
13
Sample Output
12
Explanation
We can have length = 13 and breadth = 1.
10
Sample Output
3
Explanation
We can have length = 2 and breadth = 5.
Sample Input
13
Sample Output
12
Explanation
We can have length = 13 and breadth = 1.