ss = gets.chomp.chars
ans = []
count = 0
flag = false
ss.each do |s|
  if s =="A" || s == "C" || s == "G" || s == "T"
    flag = true
    count += 1
  else
    ans << count
    flag = false
    count = 0
  end
end
puts ans.max
