S = eval(input())



ans = 0

for i in range(len(S)):

    tmp = 0

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

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

            tmp += 1

        else:

            ans = max(ans, tmp)

            break

        if j == len(S) - 1:

            ans = max(ans, tmp)



print(ans)





S = eval(input())



ans = 0

for i in range(len(S)):

    tmp = 0

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

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

            tmp += 1

        else:

            break

    ans = max(ans, tmp)



print(ans)





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

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

-            ans = max(ans, tmp) -        if j == len(S) - 1: -            ans = max(ans, tmp) +    ans = max(ans, tmp)