S=eval(input())

T='ATCG'

 

flag =0

ans =0

 

for i in range(len(S)):

    flag =0

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

        if S[j] == 'A' or S[j] == 'G' or S[j] == 'T' or S[j] == 'C':

            flag +=1

            ans = max(ans,flag)

        else:

            break

        

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

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

ans=0

cnt=0

N=len(S)



for i in range(N):

    cnt=0

    for j in range(0,N-i):

        if S[i+j] in A:

            cnt+=1

        else:

            break

    ans=max(ans,cnt)

print(ans)
S = eval(input())
T = "ATCG"
flag = 0
ans = 0
for i in range(len(S)):
    flag = 0
    for j in range(i, len(S)):
        if S[j] == "A" or S[j] == "G" or S[j] == "T" or S[j] == "C":
            flag += 1
            ans = max(ans, flag)
        else:
            break
print(ans)

S = eval(input())
A = ["A", "G", "T", "C"]
ans = 0
cnt = 0
N = len(S)
for i in range(N):
    cnt = 0
    for j in range(0, N - i):
        if S[i + j] in A:
            cnt += 1
        else:
            break
    ans = max(ans, cnt)
print(ans)

-T = "ATCG" -flag = 0 +A = ["A", "G", "T", "C"] -for i in range(len(S)): -    flag = 0 -    for j in range(i, len(S)): -        if S[j] == "A" or S[j] == "G" or S[j] == "T" or S[j] == "C": -            flag += 1 -            ans = max(ans, flag) +cnt = 0 +N = len(S) +for i in range(N): +    cnt = 0 +    for j in range(0, N - i): +        if S[i + j] in A: +            cnt += 1 +    ans = max(ans, cnt)