peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
ans = 0

def check(sub):
    check_s = set(list("ACGT"))
    for c in sub:
        if not c in check_s:
            return 0
    return len(sub)    
    
for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        ans = max(ans, check(s[i:j]))

print(ans)
S = input()

c = 0
cmax = -1
for s in S:
  if s in ['A', 'C', 'G', 'T']:
    c += 1
  else:
    if c > cmax:
      cmax = c
    c = 0
    
if c > cmax:
  cmax = c
c = 0

print(cmax)
s = 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 = input()
A = ["A", "G", "C", "T"]
cnt = 0
Max = 0
for i in range(len(S)):
    if S[i] in A:
        cnt += 1
        Max = max(Max, cnt)
    else:
        cnt = 0
print(Max)
s = input()
n = len(s)
l = ['A','C','G','T']
ans = 0
a = 0
for i in range(n):
    if s[i] in l:
        a += 1
    else:
        a = 0
    ans = max(ans,a)
print(ans)
gene = ["A","T","G","C"]

S = list(input())

ans = 0
tmp = 0

for i in range(len(S)):
    if S[i] in gene:
        tmp += 1
        ans = max(ans,tmp)
    else:
        tmp = 0

print(ans)
S = input()
count = 0
max = 0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'G' or S[i] == 'T' or S[i] == 'C':
        count += 1
        if max < count:
            max = count
    else:
        count = 0
print(max)
S = input()

ans = 0 
ans_lis = [0]

for i in range(len(S)):
    if S[i] in "ACGT":
        ans = ans + 1 
        if i == (len(S)-1):
            ans_lis.append(ans)
    else:
        ans_lis.append(ans)
        ans = 0 

print(max(ans_lis))
S = input()

cnt = 0
results = []

for i in range(len(S)):
    if S[i] in ['A', 'C', 'G', 'T']:
        cnt += 1
    else :
        results.append(cnt)
        cnt = 0
    results.append(cnt)
    
print(max(results))
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

S = input()
N = len(S)
ans = 0
for i in range(N):
    for j in range(N - i + 1):
        if all(c in 'AGCT' for c in S[i:i + j]):
            ans = max(ans, j)
print(ans)
a="".join(["1" if s in ["A","C","G","T"] else "0" for s in input()])
ans=[len(s) for s in a.split("0")]
print(max(ans))
S=input()
ans=cur=0
for c in S:
    if c in 'ACGT':
        cur+=1
        ans=max(ans,cur)
    else:
        cur=0
print(ans)
S=input()
m=0
count=0
for s in S:
    if s in "A":count+=1
    elif s in "C":count+=1
    elif s in "G":count+=1
    elif s in "T":count+=1
    else:count=0
    m=max(m,count)
print(m)
S = input()
tf = []
for s in S:
    if s in "ACGT":
        tf.append(True)
    else:
        tf.append(False)

ans = 0
temp = 0
for res in tf:
    if res:
        temp += 1
    else:
        temp = 0
    ans = max(ans, temp)
print(ans)
s = input()
ACGT = ["A","C","G","T"]
ans = 0
ANS = [0]

for i in range(len(s)):
    if s[i] in ACGT:
        ans += 1
    else:
        ans = 0
        
    ANS.append(ans)
        
print(max(ANS))
from math import gcd
import re
s=input()
match=re.findall("[ACGT]*",s)
length=0
for i in match:
    length=max(length,len(i))
print(length)
S=input()
n=len(S)
ans=0

no=False
for i in range(n):
    for j in range(i,n):
        for k in range(i,j+1):
            if not S[k] in ("A","C","G","T"):
                no=True
                break
        if no:
            no=False
            break
        ans=max(ans,j-i+1)
print(ans)
import sys

input = sys.stdin.readline

def main():
    t = 'ATGC'
    ans = 0
    S = input()
    temp = 0
    for s in S:
        if s in t:
            temp += 1
        else:
            ans = max(ans, temp)
            temp = 0

    print(ans)

if __name__ == '__main__':
    main()
s = input()
cnt = 0
ans = 0
for x in s:
    if x in ['A', 'C', 'G', 'T']:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans, cnt)
print(ans)
S = list(input())
ACGT = ['A', 'C', 'G', 'T']

count_list = []
for i in range(len(S)):
    count = 0
    for j in range(i, len(S)):
        if S[j] in ACGT:
            count += 1
        else:
            break
    count_list.append(count)

print(max(count_list))
s = input()
left = 0
ans = 0
for right in range(0,len(s)):
  if s[right] in ("A","C","G","T"):
    pass
  else:
    left=right+1
  ans = max(ans,right-left+1)
print(ans)
s=input()
ans=0
for i in range(len(s)):
    for j in range(i,len(s)+1):
        if s[i:j].count("A")+s[i:j].count("T")+s[i:j].count("C")+s[i:j].count("G")==len(s[i:j]):
            ans=max(ans,len(s[i:j]))
print(ans)
S = input()
ans = 0
for i in range(len(S)):
    a = i
    k = 0
    while S[a] == 'A' or S[a] == 'C' or S[a] == 'G' or S[a] == 'T':
        k += 1
        a += 1
        if a == len(S):
            break
    ans = max(ans,k)
print(ans)
a=input()
b=0
c=0
for i in range(len(a)):
  if a[i]=="A" or a[i]=="C" or a[i]=="G" or a[i]=="T":
    b=b+1
    if c<b:
      c=b
  if a[i]!="A" and a[i]!="C" and a[i]!="G" and a[i]!="T":
    b=0
print(c)
S = input()
res = 0
l = ['A', 'C', 'G', 'T']
for i in range(len(S)):
  sub = 0
  for j in range(i, len(S)):
    if S[j] in l:
      sub += 1
    else:
      break
  if sub > res: res = sub
print(res)
s = str(input())

list = ['A','C','G','T']

score = 0
tmp = 0
for i in s:
  if(i in list):
    tmp += 1
  else:
    score = max(score,tmp)
    tmp = 0

score = max(score,tmp)
print(score)
S = input()

ACGT = 'A C G T'.split()
result = 0
tmp = 0
for i in S:
    if i in ACGT:
        tmp += 1
    else:
        tmp = 0
    if tmp > result:
        result = tmp

print(result)
S = input()
ans = 0
for i in range(len(S)):
    for j in range(i, len(S)):
        c = True
        for k in range(i, j+1):
            if S[k]!='A' and S[k]!='C' and S[k]!='G' and S[k]!='T':
                c = False
        if c and ans < j-i+1:
            ans = j-i+1
print(ans)
pat = ["A", "C", "G", "T"]

s = input()

left = right = 0
ans = 0

while left < len(s):
    right = left
    while right < len(s) and s[right] in pat:
        right += 1

    ans = max(ans, right - left)

    left = right + 1

print(ans)
s = input()
cnt = 0
ans = 0
for c in s:
  if c in 'ACGT':
    cnt += 1
    ans = max(ans, cnt)
  else:
    cnt = 0
print(ans)
S = input()
ans = 0
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+1-i)
print(ans)
# AtCoder Beginner Contest 122 B - ATCoder
import sys

S = str(input())
target = ['A', 'C', 'G', 'T']

ans = 0
temp_ans = 0
for s in S:
    if s in target:
        temp_ans += 1
    else:
        temp_ans = 0
    ans = max(ans, temp_ans)

print(ans)
items = ['A', 'C', 'G', 'T']
 
def max(a, b):
    return a if a > b else b
x= 0
y = 0
for c in list(input()):
    if c in items:
 
        y += 1
        x = max(x, y)
    else:
        y = 0
print(x)
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

def main():
    S=list(input())
    ans=0
    tmp=0
    for s in S:
        if s=='A' or s=='T' or s=='G' or s=='C':
            tmp+=1
        else:
            ans=max(ans,tmp)
            tmp=0
    ans=max(ans,tmp)
    print(ans)

if __name__ == '__main__':
    main()
S = input()
N = len(S)
ans = 0
for i in range(N):
    for j in range(i + 1, N + 1):
        ss = S[i:j]
        for c in ss:
            if not c in ("A", "C", "G", "T"):
                break
        else:
            ans = max(ans, len(ss))
print(ans)
s = input()

str_max = ""
int_max = 0
str_temp = ""
int_temp = 0

for i in s:
    if i == "A"or i == "C"or i == "G"or i == "T":
        str_temp += i
        int_temp += 1
        # print("OK", i)
    else:
        str_temp = ""
        int_temp = 0
        # print("NG", i)

    if int_max < int_temp:
        int_max = int_temp
        str_max = str_temp

print(int_max)
s = input()

ans = 0
for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
        count = 1
        for j in range(i+1, len(s)):
            if s[j] == 'A' or s[j] == 'C' or s[j] == 'G' or s[j] == 'T':
                count += 1
            else:
                break
        if ans <= count:
            ans = count
print(ans)
s = input()
S = ""
for i in s:
    if i in "ACGT":S+="1"
    else:S+="0"
print(max(list(map(len,S.split("0")))))
S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while start < length and S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start)
  start = right
print(ans)
S = input()
man = 0
cnt = 0
l = ['A', 'C', 'G', 'T']
for s in S:
    res = False
    for i in l:
        if s == i:
            cnt += 1
            res = True
    if res == False:
        cnt = 0
    if man < cnt:
        man = cnt
print(man)
S="x"+input()

T=[0]*(len(S)+1)
U={"A","C","G","T"}

for i in range(len(S)):
    if S[i] in U:
        T[i]=T[i-1]+1
    else:
        T[i]=0
print(max(T))
s = input()
import re
sep = 'B|D|E|F|H|I|J|K|L|M|N|O|P|Q|R|S|U|V|W|X|Y|Z'
print(max([len(i) for i in re.split(sep, s)]))
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = input()
    ans = 0
    tmp = 0
    acgt = ['A', 'C', 'G', 'T']
    for s in S:
        if s in acgt:
            tmp += 1
        else:
            ans = max(ans, tmp)
            tmp = 0
    ans = max(ans, tmp)
    print(ans)


if __name__ == '__main__':
    main()
if __name__ == '__main__':
	#全探索
	S = input()
	s_len = len(S)
	s1 = {"A","C","G","T"}
	
	m_len = 0
	for x in range(s_len):
		for y in range(x+1,s_len+1):
			s2 = set(S[x:y])
			s_union =  s1.union(s2)
			if len(s_union) == 4:
				m_len = max(m_len,len(S[x:y]))
	print(m_len)
s = input()
x = 0
y = 0
for i in range(len(s)):
  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
    x = x + 1
  else:
    if y < x:
      y = x
    x = 0
if y < x:
  y = x
print(y)
import re
S = input()
ACGT = re.findall('[ACGT]+',S)
if len(ACGT) > 0:
    print(max([len(s) for s in ACGT]))
else:
    print(0)
S = str(input())

data = ['A','C','G','T']

acgt = ''
for s in S:
    if s not in data:
        acgt += '.'
    else:
        acgt += s

ans = 0
for s in acgt.split('.'):
    ans = max(ans, len(s))
print(ans)
S=input()
agct='AGCT'
ans=0
for i in range(len(S)):
  cnt=0
  j=i
  while j<len(S) and S[j] in agct :
    cnt+=1
    j+=1
  ans=max(ans,cnt)
print(ans)
S = input()

max_len = 0
counter = 0
for i in S:
    if i in 'ACGT':
        counter += 1
        if max_len < counter:
            max_len = counter

    else:
        counter = 0
    

print(max_len)
S = input()
ACGT = ["A", "C", "G", "T"]
s = ""
l = []

for i in S:
    if i in ACGT:
        s += i
        l.append(s)
    else:
        l.append(s)
        s = ""

l2 = map(len, l)
print(max(l2))
#ABC122-B
s = input()
atgc = set(['A','T','G','C'])
cnt = 0
acgt_len = []
for i in range(len(s)):
    if s[i] in atgc:
        cnt += 1
        
    else:
        acgt_len.append(cnt)
        cnt = 0
        
acgt_len.append(cnt)

print(max(acgt_len))
S = input()
x = ['A', 'C', 'T', 'G']

i = 0
count = 0
ans = 0
while i < len(S):
    if S[i] in x:
        count += 1
        ans = max(ans, count)
    else:
        count = 0
    i += 1
print(ans)
s = input()
acgt = 'ACGT'
max_count = 0
i = 0
while i < len(s):
    count = 0
    if s[i] not in acgt:
        i += 1
        continue
    count += 1
    for j in range(i+1, len(s)):
        if s[j] not in acgt:
            break
        count += 1
    if count > max_count:
        max_count = count
    i += count + 1
print(max_count)
S = input()
acgt = {'A','C','G','T'}
m = 0
c = 0
for s in S:
  if s in acgt:
    c+=1
    m = max(m,c)
  else:
    m = max(m,c)
    c = 0
print(m)
s = input()
a = [-1]
b = 0
for n in range(len(s)):
    if s[n] != "A" and s[n] != "C" and s[n] != "G" and s[n] != "T":
        a.append(n)
a.append(len(s))
for n in range(len(a)-1):
    b = max(b, a[n+1]-a[n]-1)
print(b)
s = input()

answer, count = 0, 0
for c in s:
    if c in "ACGT":
        count += 1
    else:
        answer = max(answer, count)
        count = 0
answer = max(answer, count)

print(answer)
S = input()

max_length = 0
length = 0
for s in S:
    if s in ["A", "C", "G", "T"]:
        length += 1
    else:
        if length > max_length:
            max_length = length
        length = 0
if length > max_length:
        max_length = length
print(max_length)
# -*- coding:utf-8 -*-
import re
S = input()
S_sp = re.split("[^ACGT]",S)
ans = 0
for moji in S_sp:
    if len(moji) > ans:
        ans = len(moji) 

print(ans)
S=input()
ans=0
length=0
for c in S:
    if (c == 'A' or c == 'G' or c == 'C' or c == 'T'):
        length += 1
        if length > ans:
            ans = length
    else:
        length = 0

print(ans)
import re
print(max([0]+[len(r) for r in re.findall("[ACGT]+",input())]))
S = str(input())

chrs = ('A', 'C', 'G', 'T')
max_len = 0
this_len = 0
for s in S:
  if s in chrs:
    this_len += 1
  else:
    this_len = 0

  max_len = max(this_len, max_len)

print(max_len)
S = input()
m =  0
cnt = 0
for s in S:
    if s == 'A':
        cnt += 1
    elif s == 'C':
        cnt += 1
    elif s == 'G':
        cnt += 1
    elif s == 'T':
        cnt += 1
    else:
        cnt = 0
    m = max(m, cnt)
print(m)
x=["A","G","C","T"]
ans=0
now=0
for i in input():
    if i in x:
        now+=1
    else:
        now=0
    ans=max(now,ans)
print(ans)
s = input()
acgt = [0]
tmp = 0
for i in range(len(s)):
  if s[i] in ['A', 'C', 'G', 'T']:
    tmp += 1
  elif tmp > 0:
    acgt.append(tmp)
    tmp = 0

acgt.append(tmp)

print(max(acgt))
s = input()
l = list(s)
count = 0
ans = 0
for i in range(len(l)):
    if l[i] == "A" or l[i] == "T" or l[i] == "G" or l[i] == "C":
        count += 1
        continue
    ans = max(ans,count)
    count = 0
ans = max(ans,count)
print(ans)
s = input() + 'n'
ans = 0
fans = 0
for i in range(len(s)):
    if s[i] =='A' or s[i] =='C' or s[i] =='G' or s[i] =='T':
        ans += 1
    elif fans < ans:
        fans = ans
        ans = 0
print(fans)
s = input()

substring = set(['A', 'C', 'G', 'T'])

MAX = 0
i = 0
while i < len(s):
    t = 0
    for j in range(i, len(s)):
        if s[j] in substring:
            t += 1
        else:
            break
    i += 1
    MAX = max(MAX, t)
print(MAX)
import sys
S = input()
maxer = 0
count = 0
for i in range( len(S) ):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        count += 1
        if maxer < count:
            maxer = count
    else:
        count = 0
print( maxer )
dic = ["A","T","G","C"]
S = list(input())

ans = 0
count = 0
for i in range(0,len(S),1):
    if S[i] in dic:
        count += 1
        ans = max(ans,count)
    else:
        count=0
print(ans)
S = input()
N = len(S)
a,b = 0,0
l = [0]

for i in range(N):
  if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
    a += 1
    b = 1
  else:
    if b:
      l.append(a)
      b = 0
      a = 0
else:
  if a:
    l.append(a)
  print(max(l))
s=input()
n=len(s)
def check(s):
    a=list(set(list(s)))
    b=list("ACGT")
    for i in b:
        if i in a:
            a.remove(i)
    if a==[]:
        return len(s)
    return 0
ans=0
for i in range(n):
    for j in range(n+1):
        ans=max(ans,check(s[i:j]))
print(ans)
s=input()
ACGT=["A","C","G","T"]
moji=[]
for i in range(len(s)):
    #print(moji)
    if s[i] in ACGT:
        moji.append(s[i])
        for j in range(i+1,len(s)):
            if s[j] in ACGT:
                moji[i]+=s[j]
            else:
                break
    else:
        moji.append("")
index=0
for i in moji:
    moji[index]=len(i)
    index+=1
print(max(moji))
S = 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 = list(input())

c = 0
ans = 0

for i in S:
    if i=='A' or i=='C' or i=='G' or i=='T':
        c += 1
        if ans < c:
            ans = c
    else:
        c = 0

print(ans)
s = input()
l = len(s)
ans = 0
for i in range(l):
    loc = 0
    idx = i 
    while s[idx] in ["A","C","G","T"] and idx<l:
        loc += 1
        idx += 1
        if idx>=l:
            break
    ans = max(ans,loc)
print(ans)
S = input()
L = ["A","G","C","T"]

cnt = 0
maxcnt = 0
for i in range(len(S)):
    if S[i] in L:
        cnt += 1
    else:
        if maxcnt < cnt:
            maxcnt = cnt
        cnt = 0
if maxcnt < cnt:
    maxcnt = cnt
print(maxcnt)
# -*- coding: utf-8 -*-

S = input().strip()

max_cnt=0
cnt=0
for i in range(len(S)):
    
    if S[i] in "ACGT":
        cnt += 1
    else:
        max_cnt = max(max_cnt,cnt)
        cnt = 0

max_cnt = max(max_cnt,cnt)
print(max_cnt)
s = input()
n = len(s)
ans = 0
for i in range(n):
    for j in range(i, n):
        ok = True
        for k in range(i, j + 1):
            if s[k] not in ['A', 'T', 'G', 'C']:
                ok = False
        if ok:
            ans = max(ans, j - i + 1)
print(ans)
S=input()
H="AGTC"

ans=0
cnt=0
for i in range(len(S)):
    if S[i] in H:
        cnt+=1
        ans=max(ans,cnt)
    else:
        cnt=0
        
print(ans)
S=input()

max_bubun_length=0
tmp_bubun_length = 0
for i in range(len(S)):
    # print(S[i])
    # print(tmp_bubun_length)
    # print(max_bubun_length)
    if S[i] in "ACGT":
        tmp_bubun_length += 1
    else:
        if tmp_bubun_length > max_bubun_length:
            max_bubun_length = tmp_bubun_length
            # print(S[(i-tmp_bubun_length):i])
        tmp_bubun_length = 0
if tmp_bubun_length > max_bubun_length:
    max_bubun_length = tmp_bubun_length
print(max_bubun_length)
S = input()
List = list(S)

ans = 0
arr = []
for i in range(len(List)):
  if List[i] == "A" or List[i] == "C" or List[i] == "G" or List[i] == "T":
    ans += 1
  else:
    arr.append(ans)
    ans = 0
    
arr.append(ans)

print(max(arr))
s = input()

moji = ("A","C","G","T")
count = [0]
tmp = 0
for i in range(len(s)):
    if s[i] in moji:
        tmp +=1
    else:
        count.append(tmp)
        tmp = 0
count.append(tmp)
print(max(count))
s = input()
dp = [0]*(len(s) + 1)

for i, x in enumerate(s):
    if x in "ACGT":
        dp[i+1] = dp[i] + 1
print(max(dp))
s = input()
n = len(s)
ans = 0
for i in range(n):
    for j in range(i,n):
        if all("ATGC".count(c) == 1 for c in s[i:j+1]):
            ans = max(ans,j - i + 1)
print(ans)
s=input()
gene = ["A","T","G","C"]
ans=0
counter=0
for i in range(len(s)):
	for j in range(i,len(s)):
		if(s[j] in gene):
			counter += 1
		else:
			if(counter > ans):
				ans=counter
			counter=0
			break
	if(counter > ans):
		ans=counter
	counter=0
print(ans)
S = input()
result = 0
for i in range(len(S)):
    head = S[i:]
    for j in range(len(head)):
        tail = head[:j + 1]
        if len(list(filter(lambda x: x not in "ACGT", tail))) == 0:
            result = len(tail) if len(tail) > result else result
print(result)
S=input()
DNA=['A','T','C','G']

count=0
v=0
for ch in S:
  if ch in DNA:
    count+=1
  else:
    if v < count:
      v=count
      count=0
    else:
      count=0
if v < count:
  v=count

print(v)
S = input()
ans = 0
count = 0
ACGT = ['A', 'C', 'G', 'T']
for i in range(len(S)):
    for j in range(i, len(S)):
        if all(ACGT.count(c) == 1 for c in S[i : j+1]):
            ans = max(ans, j-i+1)
print(ans)
S = list(input())
ACGT = ["A", "C", "G", "T"]
count = 0
Max = 0
if len(S) == 1:
    if  S[0] in ACGT:
        print(1)
    else:
        print(0)
else:
    for s in S:
        if s in ACGT:
            count += 1
            if count > Max:
                Max = count
        else:
            if count > Max:
                Max = count
            count = 0
    print(Max)
import re
print(len(max("".join(re.sub(r"[^ATCG]", " ", input())).split(" "), key=lambda x: len(x))))
S = input()

ma = 0
tmp = 0
acgt = ('A','C','G','T')

for s in S:
    if s in acgt:
        tmp += 1
        ma = max(ma,tmp)
    else:
        tmp = 0
print(ma)
S = input()
ret = 0
for i in range(len(S)):
    for j in range(i, len(S)):
        f = True
        for k in S[i:j + 1]:
            if k not in ("ACGT"):
                f = False
                break
        if f:
            ret = max(ret, (j + 1) - i)
print(ret)
def is_acgt(s):
    for c in s:
        if c not in ["A", "C", "G", "T"]:
            return False
    return True


S = input()
ml = 0
for l in range(len(S)+1):
    for r in reversed(range(len(S)+1)):
        if l <= r and is_acgt(S[l:r]):
            ml = max(ml, r-l)
print(ml)
s=str(input())
cnt=0
for i in range(len(s)):
    tmp=0
    for j in range(len(s)-i):
        
        if(s[i+j]=="A"or s[i+j]=="C"or s[i+j]=="G" or s[i+j]=="T"):
            tmp+=1
        else:
            break
    cnt = max(cnt,tmp)

print(cnt)
s = input()
a = ['A', 'C', 'G', 'T']
ans = []
k = 0
for i in range(len(s)):
  if s[i] in a:
    k += 1
  else:
    ans.append(k)
    k = 0
ans.append(k)
print(max(ans))
S = input()

cnt = 0
ans = 0
for s in S:
    if s not in ("A", "C", "G", "T"):
        cnt = 0
    else:
        cnt += 1
    ans = max(ans, cnt)
print(ans)
s=input()
acgt=['A','C','G','T']
m=0
cnt=0
for i in range(len(s)):
    if s[i] in acgt:
        cnt+=1
    else:
        m=max(cnt,m)
        cnt=0
print(max(cnt,m))
s=str(input())
s=list(s)
l=len(s)
ans=0
temp=0
for i in range(0,l):
  if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
    temp=temp+1
    ans=max(ans,temp)
  else:
    temp=0
print(ans)
s = input()
for i in range(len(s)+1):
    for j in range(len(s)-i+1):
        if [k for k in s[j:j+i]] == [k for k in s[j:j+i] if k=='A' or k=='G' or k=='C' or k=='T']:
            a=i
print(a)
s = input()

acgt = 'ACGT'
res = cnt = 0
for i in s:
    if i in acgt:
        cnt += 1
    else:
        res = max(cnt, res)
        cnt = 0
res = max(cnt, res)
print(res)
S = list(input())
A = ['A', 'C', 'G', 'T']
T = []
ans = 0
for e in S:
	if e in A:
		ans += 1
	else:
		T.append(ans)
		ans = 0
T.append(ans)
print(max(T))
S = input()
N = len(S)
l = []
for i in range(N):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        l.append(1)
    else:
        l.append(0)

#print(l)

ans = 0

for i in range(N):
    for j in range(i, N):
        tf = True
        for k in range(i, j + 1):
            if l[k] == 0:
                tf = False
        if tf == True:
            ans = max(ans, j - i + 1)
print(ans)
s = raw_input()
a = set(list('ACGT'))
j = 0
i = 0
r = 0
while( j < len(s)):
	if s[j] not in a:
		j += 1
		i = j 
	else:
		while(j < len(s) and s[j] in a): j+=1
		r = max(r, j - i )
		i = j
print r
import re

S = input()

m = re.findall(r"[ACGT]+", S)
if m:
    print(max(map(len, m)))
else:
    print(0)
S = input()
N = len(S)

length = 0
for i in range(N):
  for j in range(i,N):
    if all([(c in 'ACGT') for c in S[i:j+1]]):
      length = max(length, len(S[i:j+1]))

print(length)
S = input()

ans = 0
tmp = 0
for s in S:
  if s in ["A", "C", "G", "T"]:
    tmp += 1
  else:
    ans = max(ans, tmp)
    tmp = 0
ans = max(ans, tmp)

print(ans)
def actual(s):
    is_agct = lambda string: set(string).issubset({'A', 'G', 'C', 'T'})

    N = len(s)

    answer = 0

    for i in range(N):
        for j in range(N):
            substr = s[i:j + 1]  # スライスの後半は要素数を超えてもエラーにならないことに注意

            if is_agct(substr):
                answer = max(answer, len(substr))

    return answer


s = input()
print(actual(s))
# -*- coding: utf-8 -*-
# 標準入力を取得
S = input()

# 求解処理
N = len(S)
ans = 0
ACGT = ["A", "C", "G", "T"]
for i in range(N):
    if S[i] not in ACGT:
        continue
    length = 1
    for j in range(i + 1, N):
        if S[j] not in ACGT:
            break
        length += 1
    ans = max(ans, length)

# 結果出力
print(ans)
S = 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 = input()
cnt = 0
ans = 0
for c in s:
    if c in "ACGT":
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
print(ans)