program ABC122B
    implicit none
    integer i,j,ans,Slen
    character(10)::S
    read*,S
    Slen=len_trim(S)
    ans=0
    do i=1,Slen
        if(S(i:i)=="A".or.S(i:i)=="C".or.S(i:i)=="G".or.S(i:i)=="T")then
            do j=i+1,Slen
                if(S(j:j)/="A".and.S(j:j)/="C".and.S(j:j)/="G".and.S(j:j)/="T")then
                    !if(j-i>ans)print'(i0,1x,i0)',i,j
                    ans=max(ans,j-i)
                    exit
                end if
            end do
        end if
    end do
    print'(i0)',ans
end program ABC122B