require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
s = gets.chomp

ans = 0
tmp = 0
s.size.times do |i|
  if "ACGT".split(//).include? s[i]
    tmp += 1
  else
    tmp = 0
  end

  ans = tmp if ans < tmp
end
puts ans
