
s = gets.chomp!
pos=0
len=0
fpos = 0
now_len=-1
now_fpos=-1
s.chars{|c|
    #puts "adflkjasd"
    if (c=="A" || c=="T" || c=="C" || c=="G") then
        if (now_fpos==-1||now_len==-1) then
            now_fpos=pos
            now_len=1
        else
            now_len+=1
        end
    else
        if len<now_len then
            len=now_len
            fpos=now_fpos
        end
        now_fpos = -1
        now_len = -1
    end
    #puts "now_len = #{now_len},len=#{len}"
    pos+=1
}
if len<now_len then len = now_len;fpos=now_fpos; end
puts len
