S = eval(input())

N = len(S)



ans = 0

for i in range(N):

  for j in range(i, N):

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

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

print(ans)
S=list(eval(input()))



maxlen=0

for i in range(len(S)):

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

        for k in range(i,j+1):

            #cnt=0

            if S[k]!='A' and S[k]!='C' and S[k]!='G' and S[k]!='T':

                break

            if k==j and j-i+1>maxlen:

                maxlen=j-i+1

print(maxlen)

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

S = list(eval(input()))
maxlen = 0
for i in range(len(S)):
    for j in range(i, len(S)):
        for k in range(i, j + 1):
            # cnt=0
            if S[k] != "A" and S[k] != "C" and S[k] != "G" and S[k] != "T":
                break
            if k == j and j - i + 1 > maxlen:
                maxlen = j - i + 1
print(maxlen)

-S = eval(input()) -N = len(S) -ans = 0 -for i in range(N): -    for j in range(i, N): -        if all("ACGT".count(c) == 1 for c in S[i : j + 1]): -            ans = max(ans, j - i + 1) -print(ans) +S = list(eval(input())) +maxlen = 0 +for i in range(len(S)): +    for j in range(i, len(S)): +        for k in range(i, j + 1): +            # cnt=0 +            if S[k] != "A" and S[k] != "C" and S[k] != "G" and S[k] != "T": +                break +            if k == j and j - i + 1 > maxlen: +                maxlen = j - i + 1 +print(maxlen)