s = gets.strip.to_s
i = 0
t = 0
ary = []
while i < s.size do
  if s[i] == "A" || s[i] == "T" || s[i] == "C" || s[i] == "G"
    t += 1
  else
    ary.unshift(t)
    t = 0
  end
  i += 1
end
puts ary.max