let _ =
let c = read_int () in
let r = int_of_float (sqrt (float c)) in
if r * r = c then print_int (2*r - 1)
else print_int (-1)