S = STDIN.gets.chomp
s = S + 'O' # ACGT文字列でないものを最後尾に追加

index = 0
length = 0
tmpIndex = 0
tmpLength = 0

s.chars { |c|
  if c == 'A' || c == 'C' || c == 'G' || c == 'T' then
    if tmpLength == 0 then
      tmpLength = 1
    else
      tmpLength += 1
    end
  else
    if tmpLength > 0 then
      if length < tmpLength then
        length = tmpLength
      end
      tmpLength = 0
    end                                                                   
  end
}

puts length