Scanf.scanf "%d" (fun n ->
    let i = int_of_float (sqrt (float n)) in

    let digits a = string_of_int a |> String.length in
    let rec loop k =
        if n mod k = 0 then digits (n /k) else loop (k - 1)
    in
    loop i |> Printf.printf "%d\n"
)