s=eval(input())

mx=0

for i in range(len(s)):

  a=s[:len(s)-i]

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

    b=a[j:]

    if b.count('A')+b.count('C')+b.count('G')+b.count('T')==len(b):

      mx=max(mx,len(b))

print(mx)
s=eval(input())

n=len(s)

a=[0]*n

for i in range(n):

  if s[i] in 'ATCG':a[i]=a[i-1]+1

  else:a[i]=0

print((max(a)))
s = eval(input())
mx = 0
for i in range(len(s)):
    a = s[: len(s) - i]
    for j in range(len(s) - i):
        b = a[j:]
        if b.count("A") + b.count("C") + b.count("G") + b.count("T") == len(b):
            mx = max(mx, len(b))
print(mx)

s = eval(input())
n = len(s)
a = [0] * n
for i in range(n):
    if s[i] in "ATCG":
        a[i] = a[i - 1] + 1
    else:
        a[i] = 0
print((max(a)))

-mx = 0 -for i in range(len(s)): -    a = s[: len(s) - i] -    for j in range(len(s) - i): -        b = a[j:] -        if b.count("A") + b.count("C") + b.count("G") + b.count("T") == len(b): -            mx = max(mx, len(b)) -print(mx) +n = len(s) +a = [0] * n +for i in range(n): +    if s[i] in "ATCG": +        a[i] = a[i - 1] + 1 +    else: +        a[i] = 0 +print((max(a)))