

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 = eval(input())

ans = 0

for i in range(len(s)):

    count = 0

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

        if s[j] in "ACGT":

            count += 1

        else:

            break

    if count >= ans:

        ans = count

print(ans)

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 = eval(input())
ans = 0
for i in range(len(s)):
    count = 0
    for j in range(i, len(s)):
        if s[j] in "ACGT":
            count += 1
        else:
            break
    if count >= ans:
        ans = count
print(ans)

-n = len(s) -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) +for i in range(len(s)): +    count = 0 +    for j in range(i, len(s)): +        if s[j] in "ACGT": +            count += 1 +        else: +            break +    if count >= ans: +        ans = count