change [] n = []
change (d:dx) n =
    case d of
        'A' -> [n] ++ change dx (n + 1)
        'T' -> [n] ++ change dx (n + 1)
        'C' -> [n] ++ change dx (n + 1)
        'G' -> [n] ++ change dx (n + 1)
        _ -> [0] ++ change dx 1

solve s = maximum (change s 1)

main::IO()
main=do
    s <- getLine
    print $ solve s
