Problem:


Score : 200 points

Problem Statement

You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.

Here, a ACGT string is a string that contains no characters other than A, C, G and T.

Notes

A substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.

For example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and  (the empty string), but not AC.

Constraints

S is a string of length between 1 and 10 (inclusive).

Each character in S is an uppercase English letter.

Input

Input is given from Standard Input in the following format:

S

Output

Print the length of the longest ACGT string that is a substring of S.

Sample Input 1

ATCODER

Sample Output 1

3

Among the ACGT strings that are substrings of ATCODER, the longest one is ATC.

Sample Input 2

HATAGAYA

Sample Output 2

5

Among the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.

Sample Input 3

SHINJUKU

Sample Output 3

0

Among the ACGT strings that are substrings of SHINJUKU, the longest one is  (the empty string).



Sample input:
ATCODER


Sample output:
3

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
for i in range(1,len(s)+1): #i文字の文字列について調べる
    for j in range(len(s)-1): #j文字目でスタートしたとして
        if all(s[k]=='A' or s[k]=='G' or s[k]=='C' or s[k]=='T' for k in range(j,j+i)):
            ans = i
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
#print(lo)
if lis[0]>=lo:
  lo=lis[0]
#print(lo)
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
#print(lo)
print(lo)

Submission status: Runtime Error

Solution code:
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
#print(lo)
if lis[0]>=lo:
  lo=lis[0]
#print(lo)
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
#print(lo)
print(lis,lo)

Submission status: Runtime Error

Solution code:
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
print(lo)

Submission status: Runtime Error

Solution code:
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
print(lo)

Submission status: Runtime Error

Solution code:
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]+1>=lo:
  lo=le-lis[-1]-1
print(lo)

Submission status: Runtime Error

Solution code:
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if len(lis)-lis[-1]+1>=lo:
  lo=len(lis)-lis[-1]-1
print(lo)

Submission status: Runtime Error

Solution code:
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if len(lis)-lis[-1]+1>=lo:
  lo=len(lis)-lis[-1]+1
print(lo)

Submission status: Runtime Error

Solution code:
s=input()
n=len(s)
list=['A','C','G','T']
ans=[]
for i in range(n):
  k=0
  while i+k<=n-1:
    if all(a in list for a in s[i:i+k+1]):
      ans.append(k+1)
    k+=1
print(max(ans))

Submission status: Runtime Error

Solution code:
acgt = list("ACGT")
ans = []
cnt = 0

for s in input():

    if not s in acgt:
        ans.append(cnt)
        continue
    
    cnt += 1

print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
count_max = 0

for k in range(len(s)):
    if S[k] == "A" or S[k] == "C" or S[k] == "G" or S[k] == "T":
        count += 1
        if count > count_max:
             count_max = count
    else:
        count=0
print(count_max)

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
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)

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
for i in range(n):
    for j in range(i,n):
        if all("ATGC".cout(c) == 1 for c in s[i:j+1]):
            ans = max(ans,j - i + 1)
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
for i in range(n):
    for j in range(i,n):
        if all("ATGC".cout(c) for c in s[i:j+1]):
            ans = max(ans,j - i + 1)
print(ans)

Submission status: Runtime Error

Solution code:
s = input()

str = []
ans = []

for i in range(len(s)):
    if s[i] in "ACGT":
        str.append(s[i])
    else:
        ans.append(len(str))
        str = []
print(max(ans))
print(ans)

Submission status: Runtime Error

Solution code:
s = [i for i in input()]

str = []
ans = []

for i in s:
    if i in "ACGT":
        str.append(i)
    else:
        ans.append(len(str))
        str = []
print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
i = 0
ans = 0
while i < len(s):
    if s[i] == "A" or s[i] == "T" or s[i] == "C" or s[i] == "G":
        for j in range(len(s) - i):
            if s[i + j] != "A" and s[i + j] != "T" and s[i + j] != "C" and s[i + j] != "G":
                break
        ans = max(ans, j)
    i += j
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
acgt = ['A', 'C', 'G', 'T']
cnt = 0
ans = []

for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
  else:
    ans.append(cnt)
    cnt = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
import itertools
S = input()
L = len(S)

ans = 0
for i,j in itertools.combination(range(L),2):
  ss = S[i:j]
  ok = True
  for s in list(ss):
    if not(s == 'A' or s == 'C' or s == 'G' or s == 'T'):
      ok = False
      break
      
  if ok:
    ans = max(ans,j-i)
    
print(ans)

Submission status: Runtime Error

Solution code:
import re
S=input()
match=re.findall(r'[AGCT]+',S)
print(max(len(s) for s in match))

Submission status: Runtime Error

Solution code:
S = input()

la = [0]

for i in range(len(S)):
    for j in range(len(S)-i):
        ans = 0
        while S[i+j-1] == "A" or S[i+j-1] == "C" or S[i+j-1] == "G" or S[i+j-1] == "T":
            ans += 1
            j += 1
            la.append(ans)

print(max(la))

Submission status: Runtime Error

Solution code:
def resolve():
    n=int(input())
    l=list(map(int, input().split()))
    ans='YES'
    l.sort()
    for i in range(n-1):
        if l[i]==l[i+1]:
            ans='NO'
    print(ans)

resolve()

Submission status: Runtime Error

Solution code:
S=input()
ACGT=['A','C','G','T']
ans=[]
k=0
while k<len(S):
    num=0
    if S[k] in ACGT:
        num=1
        for i in range(1,len(S)-k):
            if S[k+i] in ACGT:
                num+=1
            else:
                break
        ans.append(num)
    else:
        num=1
    k+=num

print(max(ans))

Submission status: Runtime Error

Solution code:
N = list(input())
N.append(0)
for i in range(len(N)-1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

Submission status: Runtime Error

Solution code:
N = list(input())
N.appnd('Z')
for i in range(len(N)-1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

Submission status: Runtime Error

Solution code:
N = list(input())
for i in range(len(N)+1):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

Submission status: Runtime Error

Solution code:
N = list(input())
for i in range(len(N)):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

Submission status: Runtime Error

Solution code:
N = list(input)
for i in range(len(N)):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
print(max(N))

Submission status: Runtime Error

Solution code:
S = input()

length = 0
chain = -1
ans = []

for a in S:
    if a == 'A' or a == 'C' or a == 'G' or a == 'T':
        length += 1
        chain = 1
        continue
    else:
        chain = -1
        ans.append(length)
        length = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
res = []
for i in S:
    if i in ["A", "C", "G", "T"]:
        count += 1
    else:
        res.append(count)
        count = 0
print(max(res))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
res = []
for i in range(len(S)):
    if S[i] in ["A", "C", "G", "T"]:
        count += 1
    else:
        res.append(count)
        count = 0
print(max(res, 0))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
res = []
for i in range(len(S)):
    try:
        if S[i] in ["A", "C", "G", "T"]:
            count += 1
        else:
            res.append(count)
            count = 0
    except:
        continue
print(max(res))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
res = []
for i in range(len(S)):
    if S[i] in ["A", "C", "G", "T"]:
        count += 1
    else:
        res.append(count)
        count = 0
print(max(res))

Submission status: Runtime Error

Solution code:
S = input()
count = 0
res = []
for i in range(len(S)):
    if S[i] in ["A", "C", "G", "T"]:
        count += 1
    else:
        res.append(count)
        count = 0

print(max(res))

Submission status: Runtime Error

Solution code:
import sys
# input = sys.stdin.readline
from itertools import accumulate

def readlines(n):
    for _ in range(n):
        yield map(int, input().split())


def main():
    s = input()

    subst = 0
    for i in range(len(s)):
        if s[i] in "ACGT":
            subst += 1
        else:
            yield subst
            subst = 0
        
    

print(max(main()))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
S = list(input())
ACGT_filter = ['A', 'C', 'G', 'T']

str_length = 0
str_lengths = []
for s in S:
    if s in ACGT_filter:
        str_length += 1
    else:
        str_lengths.append(str_length)
        str_length = 0

print(max(str_lengths))

Submission status: Runtime Error

Solution code:
S = list(input())
ACGT_filter = ['A', 'C', 'G', 'T']

str_length = 0
str_lengths = []
for s in S:
    if s in ACGT_filter:
        print(s)
        str_length += 1
    else:
        str_lengths.append(str_length)
        str_length = 0

print(max(str_lengths))

Submission status: Runtime Error

Solution code:
s = input()
possible_answers = []
possible_answer = 0
acgt = ['A', 'C', 'G', 'T']

for i in range(len(s)):
    if s[i] in acgt:
        possible_answer += 1
    else:
        possible_answers.append(possible_answer)
        possible_answer = 0

print(max(possible_answers))

Submission status: Runtime Error

Solution code:
S = input()
max = 0
ans = 0

for i in range(10):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G':
    ans += 1
  else:
    if ans >= max:
      max = ans
    else:
      ans = 0

print(max)

Submission status: Runtime Error

Solution code:
x=["A","G","C","T"]
ans=0
for i in input():
    if i in x:
        count+=1
    else:
        count=0
    ans=max(count,ans)
        
print(ans)

Submission status: Runtime Error

Solution code:
s = input() + 'n'
ans = 0
fans = 0
for i in range(len(s)):
    if s[i] 'ACGT':
        ans += 1
    elif fans < ans:
        fans = ans
        ans = 0
print(fans)

Submission status: Runtime Error

Solution code:
# ABC 122: B – ATCoder
S = input()
ACGT = 'AGCT'
longest = 0

for start in range(len(S)):
    current = 0
    if S[start] in ACGT:
        current += 1

        if start + 1 < len(S):
            next = start + 1
            while S[next] in ACGT:
                current += 1
                next += 1
        
        longest = max(longest, current)

print(longest)

Submission status: Runtime Error

Solution code:
#ABC122B パターン１　部分文字列全探索
S=input()
N=len(S)

ans=0
'''
for i in range(N):
    if S[i] in "ACGT":
        ans=1

for l in range(N-1):
    for r in range(l+1,N):
        for s in S[l:r]:
            if not s in "ACGT":
                break
        else:
            ans=max(ans,len(S[l:r])) 
'''

for i in range(N):
    for j in range(i,N):
        if all("ACGT".count(c)==1 if for c in S[i:j+1]):
            ans=max(ans,j-i+1)

print(ans)

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
ans_l = []

if len(s) == 1:
    print(1)
    quit()
for i in range(len(s)):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        ans += 1
    else:
        ans_l.append(ans)
        ans = 0
print(max(ans_l))

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
ans_l = []
if "A" or "C" or "G" or "T" in s:
    if len(s) == 1:
        print(1)
        quit()
    for i in range(len(s)):
        if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
            ans += 1
        else:
            ans_l.append(ans)
            ans = 0
else:
    print(0)
    quit()
print(max(ans_l))

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
ans_l = []
if "A" or "C" or "G" or "T" in s:
    for i in range(len(s)):
        if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
            ans += 1
        else:
            ans_l.append(ans)
            ans = 0
else:
    print(0)
    quit()
print(max(ans_l))

Submission status: Runtime Error

Solution code:
s = list(input())
key = ['A','T','G','C']

count = 0
ans = 0
for i in range(n):
  if s[i] in key: count += 1
  else: count = 0
  ans = max(ans,count)
print(ans)

Submission status: Runtime Error

Solution code:
S = input()

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

print(max(li))

Submission status: Runtime Error

Solution code:
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]):
print(ans)
ans = max(ans, j - i + 1)

Submission status: Runtime Error

Solution code:
print(max([len(s) for s in "".join(["1" if s in ["A","C","G","T"] else " " for s in input()]).split()]))

Submission status: Runtime Error

Solution code:
moji = str(input())
length = len(moji)
mojilst = list(moji)
ans = 0
temp = []
for i in range(length):
  if str(mojilst[i]) == "A" or str(mojilst[i]) == "G" or str(mojilst[i]) == "C" or str(mojilst[i]) == "T":
    temp.append(str(mojilst[i]))
  else:
    if ans < len(temp):
      ans = len(temp)
    temp = []
    count += 1
if ans < len(temp):
      ans = len(temp)
print(ans)

Submission status: Runtime Error

Solution code:
moji = str(input())
length = len(moji)
mojilst = list(moji)
ans = 0
temp = []
for i in range(length):
  if str(mojilst[i]) == "A" or str(mojilst[i]) == "G" or str(mojilst[i]) == "C" or str(mojilst[i]) == "T":
    temp.append(str(mojilst[i]))
  else:
    if len(ans) < len(temp):
      ans = len(temp)
    temp = []
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
ACGT = ["A","C","G","T"]
ans = 0
ANS = []

for i in range(len(s)):
    if s[i] in ACGT:
        ans += 1
    else:
        ANS.append(ans)
        ans = 0
        
print(max(ANS))

Submission status: Runtime Error

Solution code:
s = str(input())
ans = 0
for i in range(len(s)):
    count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1
            else:
                break:
    if ans < count:
        ans = count
print(ans)

Submission status: Runtime Error

Solution code:
s = str(input())
ans = 0
for i in range(len(s)):
    count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1:
            else:
                break:
    if ans < count:
        ans = count
print(ans)

Submission status: Runtime Error

Solution code:
s = str(input())
ans = 0
for i in range(len(s)):
count = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(len(s)-i):
            if S[j] == "A" or "T" or "C" or "G":       
                count += 1:
            else:
                break:
    if ans < count:
        ans = count
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
cnt=0
ans = 0
sets = set([A,T,C,G])
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
cnt=0
ans = 0
sets = {A,T,C,G}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(ans)

Submission status: Runtime Error

Solution code:
S = list(input())
length = []
t = 0
for i in range(len(S)):
  if S[i]=="A" or S[i]=="C" or S[i]=="G" or S[i]=="T":
    t += 1
  else:
    length.append(t)
    t = 0
print(max(length))

Submission status: Runtime Error

Solution code:
a = input()
check = 'ACGT'
ans_list = []
for p in range(len(a)):
    for q in range(len(a)-1):
        
        count = 0
        for r in range(len(a[p:len(a)-q])):
            
            if a[p:len(a)-q][r] in check:
                count += 1
                if count == len(a[p:len(a)-q]):
                    ans_list.append(a[p:len(a)-q])
                    
                    break
ls =[]
for i in range(len(ans_list)):
    ls.append(len(ans_list[i]))

print(max(ls))

Submission status: Runtime Error

Solution code:
a = input()
ans = []
count = 0
for i in range(len(a)):
    b = a[i]
    if b == 'A':
        count +=1
    elif b == 'C':
        count+=1
    elif b == 'G':
        count+=1
    elif b == 'T':
        count+=1
    else:
        ans.append(count)
        count = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
S=list(input())
A=[0]*10
c=0
for i in range(10):
  if S[i]=="A" or S[i]=="G" or S[i]=="C" or S[i]=="T":
    A[c]+=1
  else:
    c+=1
print(max(A))

Submission status: Runtime Error

Solution code:
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
    
print(max(arr))

Submission status: Runtime Error

Solution code:
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.appned(ans)
    ans = 0
    
print(max(arr))

Submission status: Runtime Error

Solution code:
s = list(input())
l = ["A", "C", "G", "T"]
l2 = []
cnt = 0
for i in range(len(s)):
    if s[i] in l:
        cnt += 1
    else:
        l2.append(cnt)
        cnt = 0
print(max(l2))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
n = len(s)
ans = 0
lst = ['A','T','G','C']
for i in range(n):
    if s[i] not in lst:
        continue
    for j in range(i+1,n):
        if s[j] not in lst:
            break
    ans = max(ans,j-i)
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
listS = list(S)
N = []
dic = ['A', 'T', 'G', 'C']
count = 0
for i in range(len(listS)):
    if listS[i] in dic:
        count += 1
        N.append(count)
    else:
        count = 0

print(max(N))

Submission status: Runtime Error

Solution code:
s =input()
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    if i in ACGT:
        cnt += 1
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

Submission status: Runtime Error

Solution code:
# ABC122_B
s = input()
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    for k in ACGT:
        if i == k:
            cnt += 1
            continue
    if all([i != k for k in ACGT]):
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

Submission status: Runtime Error

Solution code:
# ABC122_B
s = input()
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    for k in ACGT:
        if i == k:
            cnt += 1
        if all([i != k for k in ACGT]):
            cnt_list.append(cnt)
            cnt = 0
print(max(cnt_list))

Submission status: Runtime Error

Solution code:
S=input()
anlist=[]
check=["A","C","G","T"]
a=0
for i in S:
  if i in check:
    a+=1
  else:
    anlist.append(a)
    a=0
print(max(anlist))

Submission status: Runtime Error

Solution code:
S = input()
A = 0
B = []
for i in S:
  if i == 'A' or i == 'C' or i == 'G' or i == 'T':
    A += 1
  else:
    B.append(A)
    A = 0

print(max(B))

Submission status: Runtime Error

Solution code:
s = input()
count = 0
ans = []
for i in s:
    if i == 'A'or i=='G' or i == 'T' or i == 'C':
        count +=1
    else:
        ans.append(count)
        count = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
import re
ans = max(map(len, re.findall("[ACGT]+", input())))
print(ans)

Submission status: Runtime Error

Solution code:
import re

S=input()
ans = sorted((re.findall("[AGCT]+", S)), reverse=True, key=len)
print(len(ans[0]))

Submission status: Runtime Error

Solution code:
import re
X=sorted(re.findall("[ACGT]+",input()), key=len)
print(len(X[-1]))

Submission status: Runtime Error

Solution code:
import re
X=sorted(re.findall("[ACGT]+",input()), len=True)
print(len(X[-1]))

Submission status: Runtime Error

Solution code:
import re

S=input()
ans = sorted((re.findall("[AGCT]*", S)), reverse=True, key=len)
print(len(ans[0])

Submission status: Runtime Error

Solution code:
import re

S=input()
ans = sorted((re.findall("[AGCT]*", S), reverse=True, key=len)
print(ans[0])

Submission status: Runtime Error

Solution code:
S = list(map(str, input()))
cnt = 0
CNT = []
for i in range(len(S)):
    if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T':
        cnt += 1
    if S[i]!='A' and S[i]!='C' and S[i]!='G' and S[i]!='T':
        CNT.append(cnt)
        cnt = 0

print(max(CNT))

Submission status: Runtime Error

Solution code:
import re
S = input()
print(max([len(s) for s in re.findall('[ACGT]+',S)]))

Submission status: Runtime Error

Solution code:
s = str(input())
ACGT = {"A", "C", "G", "T"}

ans = 0
for i in range(len(s)):
    for j in range(i, len(s) + 1):
        k = s[i: j]
        for l in k:
            if l not in ACGT:
                break
        else:
            ans = max(ans, len(t))
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
count = 0
c = []
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        count += 1
    else:
        c.append(count)
        count = 0
print(max(c))

Submission status: Runtime Error

Solution code:
s = input()
list_s = list(s)
k = 0
ans = []
for i in range(len(list_s)):
    c = list_s[i]
    if c == "A" or c == "C" or c == "G" or c == "T":
        k += 1
    else:
        ans.append(k)
        k = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
list_s = list(s)
k = 0
ans = []
for c in list_s:
    if c == "A" or c == "C" or c == "G" or c == "T":
        k += 1
    else:
        ans.append(k)
        k = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
l = []
cnt = 0
for i in s:
    if i == "A" or i =="C" or i == "G" or i == "T":
        cnt += 1
        
    else:
        l.append(cnt)
print(max(l))

Submission status: Runtime Error

Solution code:
S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while 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)

Submission status: Runtime Error

Solution code:
S=input()

ans=[]
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
    else:
        ans.append(count)
        count=0

print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
print(max(k))

Submission status: Runtime Error

Solution code:
s = input() ; c = 0 ; l = []

for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        c += 1
    if i != 'A' and i != 'T' and i != 'G' and i != 'C':
        l.append(c)
        c = 0
        
print(max(l))

Submission status: Runtime Error

Solution code:
s = input() ; c = 0 ; l = []

for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        c += 1
    if i != 'A' and i != 'T' and i != 'G' and i != 'C':
        l.append(c)
        c = 0
        
print(l(max))

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    s = input()
    ss = all_part_string(s)
    o = [e for e in ss if contains_only(e, "ACGT")]
    print(0 if len(sorted(o, key=len, reverse=True)) == 0 else len(sorted(o, key=len, reverse=True)[0]))

Submission status: Runtime Error

Solution code:
#ABC122

s = input()

d = ["A","T","G","C"]
l = []
count = 0
for i in range(len(s)):
    if s[i] not in d:
        l.append(count)
        count = 0
    else:
        count += 1
    #print(count)
print(max(l))

Submission status: Runtime Error

Solution code:
S=input()
ans=0
for i in range(len(S)):
    cnt=0
    k=i
    while True:
        if S[k] in ["A","C","G","T"] and k<len(S):
            cnt+=1
            k+=1
        else:
            if cnt>ans:
                ans=cnt
            break
print(ans)

Submission status: Runtime Error

Solution code:
S=input()
ans=0
for i in range(len(S)):
    cnt=0
    while True:
        if S[i] in ["A","C","G","T"] and i<len(S):
            cnt+=1
            i+=1
        else:
            if cnt>ans:
                ans=cnt
            break
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
ans=0
cur=0
ACGT=set("A","C","G","T")
for ss in s:
  if ss in ACGT:
    cur+=1
  else:
    ans=max(cur,ans)
    cur=0
print(max(ans,cur))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
# B
s = list(input())

count = 0
l = []
for i in range(len(s)):
    if s[i] == 'A':
        count += 1
        continue
    elif s[i] == 'C':
        count += 1
        continue
    elif s[i] == 'G':
        count += 1
        continue
    elif s[i] == 'T':
        count += 1
        continue
    else:
        l.append(count)
        count = 0

print(max(l))

Submission status: Runtime Error

Solution code:
pat = ["A", "C", "G", "T"]

s = input()

left = right = 0
ans = 0

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

    ans = max(ans, right - left)

    left = right + 1

print(ans)

Submission status: Runtime Error

Solution code:
pat = ["A", "C", "G", "T"]

s = input()

left = right=0
ans = 0

while left<len(s):
  right = left
  while s[right] in pat:
    right+=1
  
  ans = min(ans, right - left)
  
  left = right+1
  
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
ans = []
count = 0
for i in range(len(s)):
    if  s[i]  in"ACGT":
            count +=1
    else:
        ans.append(count)
        count = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
s = input()
ans = []
cnt = 0

for i in range(len(s)):
    for j in range(2, len(s) + 1):
        memo = s[i:j]
        for k in range(len(memo)):
            if memo[k] == 'A' or memo[k] == 'C' or memo[k] == 'T' or memo[k] == 'G':
                cnt += 1
            else:
                break

        ans.append(cnt)
        cnt = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
lst = list(input())
cnt = 0
len_lst = []
for i in lst:
    if i == 'A' or\
       i == 'T' or\
       i == 'C' or\
       i == 'G':
        cnt += 1
    else:
        len_lst.append(cnt)
        cnt = 0
print(max(len_lst))

Submission status: Runtime Error

Solution code:
s = input()
SENT = ('A','T','G','C')

ans = 0
count = 0
for c in s:
  if c in SENT:
    count += 1
  else:
    ans = max(ans,conut)
    count = 0
else:
  ans = max(ans,count)
  
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
ACGT = ['A','C','G','T']
count = 0
ans = []
for i in s:
  if i in ACGT:
    count += 1
  else:
    ans.append(count)
    count = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
 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)

Submission status: Runtime Error

Solution code:
s=input()
l=len(s)
ans=0
for i in range(l):
  for j in range(1,l):
    t=s[i:i+j]
    for k in range(j):
      if t[k] not in ['A','C','G','T']:
        break
    else:
      ans=max(ans,j-i+1)
print(ans)