e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Mosaic

Mosaic

Petya has n square cards. He wants to create from them a large square (without holes). How many cards he has left?

Input

One integer n (1n109).

Output

Print the number of cards left.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1
Output example #1
0
Input example #2
27
Output example #2
2
Source Stage II Ukrainian School Olympiad 2011-2012, Berdichev