def check(s,i):

   global count

   count+=1

   if i+1 < len(s):

       if s[i+1] == 'A' or s[i+1] == 'C' or s[i+1] =='G' or s[i+1] =='T':

           check(s,i+1) 



s=eval(input())

count=0

list=[]

for i in range(len(s)):

    count=0

    if s[i] == 'A' or s[i] == 'C' or s[i] =='G' or s[i] =='T':

        check(s,i)

    list.append(count)



print((max(list)))
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)

def check(s, i):
    global count
    count += 1
    if i + 1 < len(s):
        if s[i + 1] == "A" or s[i + 1] == "C" or s[i + 1] == "G" or s[i + 1] == "T":
            check(s, i + 1)


s = eval(input())
count = 0
list = []
for i in range(len(s)):
    count = 0
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        check(s, i)
    list.append(count)
print((max(list)))

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)

-def check(s, i): -    global count -    count += 1 -    if i + 1 < len(s): -        if s[i + 1] == "A" or s[i + 1] == "C" or s[i + 1] == "G" or s[i + 1] == "T": -            check(s, i + 1) - - -s = eval(input()) -count = 0 -list = [] -for i in range(len(s)): -    count = 0 -    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": -        check(s, i) -    list.append(count) -print((max(list))) +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)