S = gets

subs = []
result = 0

for i in 0..(S.length - 1)
  for j in 0..(S.length - 1)
	subs << S[i..j] 
  end
end
subs.each do |sub|
  acgt = true
  sub.split('').each do |s|
    if s == 'A' || s == 'C' || s == 'G' || s == 'T'
      acgt = true
    else
      acgt = false
      break
    end
  end
  result = sub.length if acgt == true && result < sub.length
end

puts result
