let rec d n ret =
  if n = 0 then ret
  else d (n / 10) (ret + 1)

let rec ans i n =
  if n mod i = 0 then d (n / i) 0
  else ans (i - 1) n

let () =
  let n = read_int () in
  let m = int_of_float (sqrt (float_of_int n)) in
  print_int (ans m n)
