s = gets.chomp
tmp = 0
max = 0
for i in 0...s.length
  if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C'
    tmp += 1
  else
    tmp = 0
  end
  max = [max, tmp].max
  # p [tmp, s[i]]
end
puts max
