def isAGCTString(str)
  temp = str.count("A") + str.count("G") + str.count("C") + str.count("T")
  return str.size == temp ? true : false
end
n=gets.chomp
agct = [0]
n.size.times do |startIndex|
  str = n[startIndex]
  next if !isAGCTString(str)
  ((startIndex+1)...n.size).each do |endIndex|
    str = n[startIndex..endIndex]
    if !isAGCTString(str)
      agct << (str.size - 1)
      break
    end
  end
end
puts agct.max
