import re

S = eval(input())

L = len(S)

mlen = 0



match = re.findall('[ATGC]+', S)

#print(match.span())

for m in match:

    if len(m) > mlen:

        mlen = len(m)

print(mlen)
S = eval(input())

L = len(S)

ans = 0

for i in range(L):

    for j in range(i, L):

        if all(c in 'AGCT' for c in S[i:j+1]):

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

print(ans)

import re

S = eval(input())
L = len(S)
mlen = 0
match = re.findall("[ATGC]+", S)
# print(match.span())
for m in match:
    if len(m) > mlen:
        mlen = len(m)
print(mlen)

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

-import re - -mlen = 0 -match = re.findall("[ATGC]+", S) -# print(match.span()) -for m in match: -    if len(m) > mlen: -        mlen = len(m) -print(mlen) +ans = 0 +for i in range(L): +    for j in range(i, L): +        if all(c in "AGCT" for c in S[i : j + 1]): +            ans = max(ans, j + 1 - i) +print(ans)