import re



S = eval(input())

pattern = "[ATGC]*"



matched_list = sorted(re.findall(pattern, S),

                      key=lambda s: len(s),

                      reverse=True)

print((len(matched_list[0])))

import re



S = eval(input())

pattern = "[ATGC]*"



matched_list = sorted(re.findall(pattern, S), key=len, reverse=True)

print((len(matched_list[0])))

import re

S = eval(input())
pattern = "[ATGC]*"
matched_list = sorted(re.findall(pattern, S), key=lambda s: len(s), reverse=True)
print((len(matched_list[0])))

import re

S = eval(input())
pattern = "[ATGC]*"
matched_list = sorted(re.findall(pattern, S), key=len, reverse=True)
print((len(matched_list[0])))

-matched_list = sorted(re.findall(pattern, S), key=lambda s: len(s), reverse=True) +matched_list = sorted(re.findall(pattern, S), key=len, reverse=True)