(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let () = Str.split (Str.regexp "[B|D|E|F|H|I|J|K|L|M|N|O|P|Q|R|S|U|V|W|X|Y|Z]") (read_line ()) 
         |> List.sort (fun a b ->
                 let alen = String.length a in
                 let blen = String.length b in
                         if alen = blen then
                                 0
                         else 
                         if alen < blen then
                                 1
                         else
                                 -1
         )
         |> List.hd
         |> String.length
         |> Printf.printf "%d\n"
