s = gets.chomp.split(//)

acgt = ["A", "C", "G", "T"]

ar = []
tmpstr = ""
idx = 0
isSplit = true
for i in 0..(s.length - 1) do
  if acgt.include?(s[i]) then
    if isSplit then
      isSplit = false
    end

    tmpstr << s[i]
  else
    unless isSplit then
      isSplit = true
      ar[idx] = tmpstr
      tmpstr = ""
      idx += 1
    end
  end
end

if ar.length == 0 then
  puts "0"
else
  puts ar.map! {|str| str.length}.max
end
