s = gets.chomp

res = 0

s.length.times do |n1|
  (s.length - n1).times do |n2|
    str = s[n1..(s.length - n2)]
    if str.tr("ATCG", "").empty?
      res = str.length if res < str.length
    end
    #i)f str.include?("A") && str.include?("T") && str.include?("C") && str.include?("G"
      #p "y"
    #end
  end
end
puts res