input = gets.chomp

count = 0
max = 0

for i in 0..input.length - 1 do
  if input[i] == 'A'
    count += 1
  elsif input[i] == 'C'
    count += 1
  elsif input[i] == 'G'
    count += 1
  elsif input[i] == 'T'
    count += 1
  else
    count = 0
  end

  max = count if max < count
end

puts max