S = gets.chomp!

max_num = 0
count = 0
S.chars {|ch|
  case ch
  when 'A','T','G','C' then
    count += 1
  else
    max_num = [max_num, count].max
    count = 0
  end
}

max_num = [max_num, count].max
print max_num
