s = list(eval(input()))



max = 0

length = 0



for i in range(len(s)):

    if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':

        length += 1

        if max < length:

            max = length

    else:

        length = 0



print(max)
s = eval(input())



word_list = ['A', 'T', 'G', 'C']



cnt = 0

max = 0



for i in s:

    if i in word_list:

        cnt += 1

        if cnt > max:

            max = cnt

    else:

        cnt = 0



print(max)
s = list(eval(input()))
max = 0
length = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "T" or s[i] == "G" or s[i] == "C":
        length += 1
        if max < length:
            max = length
    else:
        length = 0
print(max)

s = eval(input())
word_list = ["A", "T", "G", "C"]
cnt = 0
max = 0
for i in s:
    if i in word_list:
        cnt += 1
        if cnt > max:
            max = cnt
    else:
        cnt = 0
print(max)

-s = list(eval(input())) +s = eval(input()) +word_list = ["A", "T", "G", "C"] +cnt = 0 -length = 0 -for i in range(len(s)): -    if s[i] == "A" or s[i] == "T" or s[i] == "G" or s[i] == "C": -        length += 1 -        if max < length: -            max = length +for i in s: +    if i in word_list: +        cnt += 1 +        if cnt > max: +            max = cnt -        length = 0 +        cnt = 0