import re



S = eval(input())

max = 0



for i in range(len(S)) :

    for j in range(i + 1, len(S) + 1) :

        pattern = re.compile(r'[A|T|C|G]{%d}' % int(j - i))

        subStr = S[i:j]



        if pattern.match(subStr) and j - i > max :

            max = j - i



print(max)

S = eval(input())



ans = 0



for i in range(len(S)) :

    for j in range(i, len(S)) :

        if all('ACGT'.count(c) == 1 for c in S[i : j + 1]) :

            ans = max(ans, j - i + 1)





print(ans)

import re

S = eval(input())
max = 0
for i in range(len(S)):
    for j in range(i + 1, len(S) + 1):
        pattern = re.compile(r"[A|T|C|G]{%d}" % int(j - i))
        subStr = S[i:j]
        if pattern.match(subStr) and j - i > max:
            max = j - i
print(max)

S = eval(input())
ans = 0
for i in range(len(S)):
    for j in range(i, len(S)):
        if all("ACGT".count(c) == 1 for c in S[i : j + 1]):
            ans = max(ans, j - i + 1)
print(ans)

-import re - -max = 0 +ans = 0 -    for j in range(i + 1, len(S) + 1): -        pattern = re.compile(r"[A|T|C|G]{%d}" % int(j - i)) -        subStr = S[i:j] -        if pattern.match(subStr) and j - i > max: -            max = j - i -print(max) +    for j in range(i, len(S)): +        if all("ACGT".count(c) == 1 for c in S[i : j + 1]): +            ans = max(ans, j - i + 1) +print(ans)