s = gets.chomp.chars
atgc = ['A', 'T', 'G', 'C']
parts_length = []
words = []

(1...s.length).each do |k|
  (0..s.length-k-1).each do |i|
    words.push(s[i..i+k-1])
  end
end

words.each do |word|
  parts_length.push(word.count{|str| atgc.include?(str)})
end

puts parts_length.max