s = gets.chomp.split("")
num=0
ans=0
s.length.times do |i|
  case s[i]
  when /A|C|G|T/
    i.upto(s.length-1) do |j|
      case s[j]
      when /A|C|G|T/
        num+=1
      else
        break
      end
    end
    ans = num if ans < num
    num = 0
  end
end
puts ans