Scanf.scanf "%s" (fun s -> let ten = [| 226; 128; 166 |] in let n = String.length s in let rec loop i cur acc = if i = n then acc else let cur = if int_of_char s.[i] = ten.(cur mod 3) then cur + 1 else 0 in loop (i + 1) cur (max acc (cur / 3)) in loop 0 0 0 |> Printf.printf "%d\n" )