s = gets.chomp.split('')
at = ["A","T","C","G"]
cnt = 0
max_cnt = 0
s.each do |i|
  if at.include?(i)
    cnt += 1
    if cnt > max_cnt
      max_cnt = cnt
    end
  else
    cnt = 0
  end
end
puts max_cnt