s = gets.chomp.split("")
# s_re = s.reverse
# i = 0
# while true
#     if s[i] == "A" || s[i] == "G" || s[i] == "C" || s[i] == "T"
#         break
#     elsif s == []
#         break
#     else
#         s.shift
#     end
# end
# p s
# i = 0
# s = s.reverse
# while true
#     if s[i] == "A" || s[i] == "G" || s[i] == "C" || s[i] == "T"
#         break
#     elsif s == []
#         break
#     else
#         s.shift
#     end
# end
# p s
# puts s.size
count = 0
arr = []
(0..s.size).each do |i|
    if s[i] == "A" || s[i] == "G" || s[i] == "C" || s[i] == "T"
        count += 1
    else
        arr << count
        count = 0
    end
end
puts arr.sort.pop