s=eval(input())

acgt=["A","C","G","T"]

s=[s[i] in acgt for i in range(len(s))]

max_len=0

flag=False

for n in range(len(s),0,-1):

  for i in range(len(s)-n+1):

    if all(s[i:i+n]):

      max_len=n

      flag=True

      break

  if flag:

    break

print(max_len)
s=eval(input())

count,max_count=0,0

for t in s:

    if t in ["A","C","G","T"]:

        count+=1

        if max_count<count:

            max_count=count

    else:

        count=0

print(max_count)
s = eval(input())
acgt = ["A", "C", "G", "T"]
s = [s[i] in acgt for i in range(len(s))]
max_len = 0
flag = False
for n in range(len(s), 0, -1):
    for i in range(len(s) - n + 1):
        if all(s[i : i + n]):
            max_len = n
            flag = True
            break
    if flag:
        break
print(max_len)

s = eval(input())
count, max_count = 0, 0
for t in s:
    if t in ["A", "C", "G", "T"]:
        count += 1
        if max_count < count:
            max_count = count
    else:
        count = 0
print(max_count)

-acgt = ["A", "C", "G", "T"] -s = [s[i] in acgt for i in range(len(s))] -max_len = 0 -flag = False -for n in range(len(s), 0, -1): -    for i in range(len(s) - n + 1): -        if all(s[i : i + n]): -            max_len = n -            flag = True -            break -    if flag: -        break -print(max_len) +count, max_count = 0, 0 +for t in s: +    if t in ["A", "C", "G", "T"]: +        count += 1 +        if max_count < count: +            max_count = count +    else: +        count = 0 +print(max_count)