Scanf.scanf "%s" (fun s -> let n = String.length s in let rec loop i acc = if i = n then acc else loop (i + 1) (acc + if s.[i] = '0' then 10 else int_of_char s.[i] - 48) in loop 0 0 |> Printf.printf "%d\n" )