let () = Scanf.scanf "%d" @@ fun n ->
  Array.init (int_of_float (ceil @@ sqrt @@ float_of_int n)) (fun a ->
    if n mod (a + 1) = 0 then max (a + 1) (n / (a + 1))
    else max_int)
  |> Array.fold_left min max_int
  |> (fun a -> Printf.printf "%d\n" @@ succ @@ int_of_float @@ log (float_of_int a) /. log 10.)
