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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

cnt = 0
max = 0
for str in S:
  if str in {'A', 'C', 'G', 'T'}:
    cnt += 1
  else:
    if cnt < max:
      max = cnt
    cnt = 0

print(cnt)

Submission status: Wrong Answer

Solution code:
a = list(input())
b = 0
c = 0

for i in range(len(a)):
  if a[i] == "A":
    b = b + 1
  elif a[i] == "C":
    b = b + 1
  elif a[i] == "G":
    b = b + 1
  elif a[i] == "T":
    b = b + 1
  else :
    if c < b :
      c = b
      b = 0
    else :
      b = 0
if c < b :
      c = b
      b = 0
else :
      b = 0
print(b)     
print(c)

Submission status: Wrong Answer

Solution code:
a = list(input())
b = 0
c = 0

for i in range(len(a)):
  if a[i] == 'A':
    b = b + 1
  elif a[i] == 'C':
    b = b + 1
  elif a[i] == 'G':
    b = b + 1
  elif a[i] == 'T':
    b = b + 1
  else :
   if c <= b:
      c = b
      b = 0
      
print(c)

Submission status: Wrong Answer

Solution code:
a = list(input())
b = 0
c = 0

for i in range(len(a)):
  if a[i] == 'A':
    b = b + 1
  elif a[i] == 'C':
    b = b + 1
  elif a[i] == 'G':
    b = b + 1
  elif a[i] == 'T':
    b = b + 1
  elif c <= b:
      c = b
      b = 0
      
print(c)

Submission status: Wrong Answer

Solution code:
s = input()

ans=0
base = set(['A','C','G','T'])
i = 1
while i <= len(s):
    j = 0
    while j+i <= len(s):
        print (i,j,i+j)
        word = set(s[j:j+i])
        print (word)
        if word <= base:
            ans = len(s[j:j+i])
        j += 1
    i += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())
l = ['A','C','G','T']
c = 0
cplus = 0
for i in S:
    if i in l:
        cplus += 1
    else:
        if c < cplus:
            c = cplus
        cplus = 0
print(c)

Submission status: Wrong Answer

Solution code:
s = list(input())
ans = 0
count = 0
for i in s:
    if i in "AGCT":
        count += 1
    else:
        ans = max(ans, count)
        count = 0

print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
count=0
result=0
for i in S:
    if i=='A' or i=='T' or i=='G' or i=='C':
        count+=1
    else:
        result=max(result,count)
        count=0
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ren = 0
count = 0
for i in input():
    if i in "ATGC":
        count += 1
    else:
        ren = max(count, ren)
        count = 0

print(ren)

Submission status: Wrong Answer

Solution code:



def start_process(a):
    dict = ['A', 'G', 'T', 'C']

    ans = 0
    count = 0
    for char in list(a):
        if char in dict:
            count += 1
        else:
            if ans < count:
                ans = count
            count = 0
    print(ans)


def main():
    a = input()
    start_process(a)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = list(input())
ma = 0
re = 0

for s in S:
    if s in "ACGT":
        re += 1
    else:
        ma = max(ma, re)
        re = 0

print(ma)

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
tmp = ['']
x = {'A', 'C', 'G', 'T'}
for i in range(N):
    for j in range(i, N):
        if set(S[i:j+1]) <= x:
            tmp.append(S[i:j+1])
print(max(tmp, key=len))

Submission status: Wrong Answer

Solution code:
inp = input()
res = 0
for i in range(len(inp)):
  for j in range(i+1, len(inp)):
    if len([w for w in inp[i:j] if w in ["A", "C", "G", "T"]]) == (j-i):
      res = max(res, j-i)
print(res)

Submission status: Wrong Answer

Solution code:
inp = input()
res = 0
for i in range(len(inp)):
  for j in range(i, len(inp)):
    if len([w for w in inp[i:j] if w in ["A", "C", "G", "T"]]) == (j-i):
      res = max(res, j-i)
print(res)

Submission status: Wrong Answer

Solution code:
b=input()
#print(b)

ans=0
for i in range(len(b)+1):
  for j in range(len(b)+1-i):
    c=b[i:j]
    cnt=c.count('A')
    cnt+=c.count('T')
    cnt+=c.count('G')
    cnt+=c.count('C')
    setc=set(c)
    setc0=set(['A','T','G','C'])
    setc1=setc-setc0
    if len(setc1)==0 and ans < cnt:
      ans=cnt
      
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
max = 0
j = -1
for i in range(0, len(S)):
    if not(S[i]=="A" or S[i]=="C" or S[i]=="G" or S[i]=="T"):
        if max<i-j-1:
            max = i-j-1
        j = i
print("{}".format(max))

Submission status: Wrong Answer

Solution code:
S=input()
flag=0
count=0
begin=0
max_begin=0
max_count=0
for i in range(len(S)):
    if flag==0:
        
        if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            begin=i
            count+=1
            flag=1
            
    else:
        if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            count+=1
        else:
            if max_count<count:
                max_count=count
                max_begin=begin
            flag=0
            count=0
print(max_count)

Submission status: Wrong Answer

Solution code:
S=input()
flag=0
count=0
begin=0
max_begin=0
max_count=0
for i in range(len(S)):
    if flag==0:
        
        if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            begin=i
            count+=1
            flag=1
            
    else:
        if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
            count+=1
        else:
            if max_count<count:
                max_count=count
                max_begin=begin
            flag=0
            count=0
print(S[max_begin:max_count])

Submission status: Wrong Answer

Solution code:
b=input()
#print(b)

ans=0
for i in range(len(b)+1):
  for j in range(len(b)+1-i):
    c=b[i:j]
    cnt=c.count('A')
    cnt+=c.count('T')
    cnt+=c.count('G')
    cnt+=c.count('C')
    if cnt==len(c) and ans < cnt:
      ans=cnt
      
print(ans)

Submission status: Wrong Answer

Solution code:
b=input()
#print(b)

ans=0
for i in range(len(b)+1):
  for j in range(len(b)+1-i):
    c=b[i:j]
    cnt=c.count('A')
    cnt+=c.count('T')
    cnt+=c.count('G')
    cnt+=c.count('C')
    if cnt==j-i and ans < cnt:
      ans=cnt
      
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = 0
k=0
l='ACGT'
for s_ in s:
    if s_ in l:
        k+=1
    else:
        ans=max(k,ans)
        k=0
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
inp = input()
ACGT = ["", "A", "C", "G", "T"]
sentences = [i+j+k+l+m+n+o+p for i in ACGT for j in ACGT for k in ACGT for l in ACGT for m in ACGT for n in ACGT for o in ACGT for p in ACGT]
length = [len(sent) for sent in sentences if sent in inp]
print(np.max(length))

Submission status: Wrong Answer

Solution code:
import numpy as np
inp = input()
ACGT = ["", "A", "C", "G", "T"]
sentences = [i+j+k+l+m+n for i in ACGT for j in ACGT for k in ACGT for l in ACGT for m in ACGT for n in ACGT]
length = [len(sent) for sent in sentences if sent in inp]
print(np.max(length))

Submission status: Wrong Answer

Solution code:
import numpy as np
inp = input()
ACGT = ["", "A", "C", "G", "T"]
sentences = [j+k+m+n for j in ACGT for k in ACGT for m in ACGT for n in ACGT]
length = [len(sent) for sent in sentences if sent in inp]
print(np.max(length))

Submission status: Wrong Answer

Solution code:
S = input()
maxv = 0
tmp = 0
t = list("ATCG")
for i in range(len(S)):
    for j in range(i, len(S)):
        if S[j] in t:
            tmp += 1
        else:
            maxv = max(maxv, tmp)
            tmp = 0
print(maxv)

Submission status: Wrong Answer

Solution code:
S = input()
acgt = "ACGT"
res = 0
ss = ""
for s in S:
    if s in acgt:
        ss += s
    else:
        res = max(res, len(ss))
        ss = ""
print(res)

Submission status: Wrong Answer

Solution code:
S = input()
acgt = "ACGT"
res = ""
for s in S:
    if s in acgt:
        res += s
print(len(res))

Submission status: Wrong Answer

Solution code:
S = input()
ans = 0
now = 0
for i in S:
  if i in "ACGT":
    now += 1
  else:
    ans = max(ans,now)
    now = 0
print(ans)

Submission status: Wrong Answer

Solution code:
import re
S = input()
match = re.split("[^ACGT]", S)
print(len(max(match)))

Submission status: Wrong Answer

Solution code:
import re
S = input().strip()
match = re.findall("[ACGT]*", S)
print(len(max(match)))

Submission status: Wrong Answer

Solution code:
import re
S = input()
match = re.findall(R"[ACGT]*", S)
print(len(max(match)))

Submission status: Wrong Answer

Solution code:
import re
S = str(input())
match = re.findall(r"[ACGT]*", S)
print(len(max(match)))

Submission status: Wrong Answer

Solution code:
length, max_length = 0, 0
s = input()

for c in s:
    if c == 'A' or c == 'C' or c == 'G' or c == 'T':
        length += 1
    else:
        max_length = max(max_length, length)
        length = 0

print(max_length)

Submission status: Wrong Answer

Solution code:
s = input()
li = list(s)
max = 0
count = 0

for i in li:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        count += 1
    else:
        if max < count:
            max = count
        count = 0

print(max)

Submission status: Wrong Answer

Solution code:
s = input()

ma = 0
for i in range(len(s)):
    for j in range(0,len(s)-i+1):
        sbstr = s[i:i+j+1]
        print(i,j,sbstr)
        is_good = True
        for c in sbstr:
            if c not in "AGCT":
                is_good = False
                break
        if is_good:
            if (len(sbstr)) > ma :
                ma = len(sbstr)

print(ma)

Submission status: Wrong Answer

Solution code:
import re
ptn = re.compile(r"(A|C|G|T)*")

S = input()

ans = 0
for i in range(len(S)):
  for j in range(len(S)):
    x = ptn.match(S[i:i+j]).group(0)
    if(x):
      ans = max(ans, len(x))
print(ans)

Submission status: Wrong Answer

Solution code:
import re
print(map(len,re.finditer('[ACGT]*',input())))

Submission status: Wrong Answer

Solution code:
# ATCoder
# ACGTだけ
S = input()
list = [str for str in S]

def getAns(list) :
    cnt = 0
    rtn = 0
    for i in range(len(list)) :
        if list[i] == "A" :
            cnt += 1
        elif list[i] == "C" :
            cnt += 1
        elif list[i] == "G" :
            cnt += 1
        elif list[i] == "T" :
            cnt += 1
        else :
            rtn = max(cnt, rtn)
            cnt = 0
    return rtn

print(getAns(list))

Submission status: Wrong Answer

Solution code:
# ATCoder
# ACGTだけ
S = input()
list = [str for str in S]

def getAns(list) :
    cnt = 0
    rtn = 0
    for i in range(len(list)) :
        for j in range(i, len(list)) :
            if list[j] == "A" :
                cnt += 1
            elif list[j] == "C" :
                cnt += 1
            elif list[j] == "G" :
                cnt += 1
            elif list[j] == "T" :
                cnt += 1
            else :
                if rtn < cnt :
                    rtn = cnt
                cnt = 0
    return rtn

print(getAns(list))

Submission status: Wrong Answer

Solution code:
S = input()

l_max, l = -1, 0

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

print(l_max)

Submission status: Wrong Answer

Solution code:
S = input()

ans, s = "", ""

for c in S:
    if c in ['A', 'C', 'G', 'T']:
        s += c
    else:
        ans = s if len(s) > len(ans) else ans
        s = ""

print(ans)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
  V = input()
  
  print(V)
  
  flg = 0
  max_v = 0
  for i in V:
    print(i)
    if i == 'A' or i=='T' or i=='G' or i=='C':
      flg += 1
      max_v = max(max_v, flg)
    else:
      flg = 0
      
  print(max_v)

Submission status: Wrong Answer

Solution code:
s = input()
ans = 0
j = 0
for i in s:
    if i != 'A' and i != 'T' and i != 'G' and i != 'C':
        ans = max(j,ans)
        j = 0
    else:
        j += 1

print(ans)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
  V = input()
  
  print(V)
  
  flg = 0
  max_v = 0
  for i in V:
    print(i)
    if i == 'A' or i=='T' or i=='G' or i=='C':
      flg += 1
      max_v = max(max_v, flg)
    else:
      flg += 0
      
  print(max_v)

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
ans =0
for i in range(0, N):
    for j in range(i, N+1):
        tmp = S[i:j]
        if len(tmp)==S.count('A')+S.count('G')+S.count('C')+S.count('T'):
            ans = max(ans,len(tmp))
print(ans)

Submission status: Wrong Answer

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

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

print(max_count)

Submission status: Wrong Answer

Solution code:
S = input()

cnt = 0
a = []
lenflag=True
for i in S:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        cnt += 1
    else:
        lenflag=False
        a.append(cnt)
        cnt = 0
if lenflag:
    a.append(len(S))
print(max(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
ret = 0
for x in range(len(S)):
    for y in range(x + 1, len(S) + 1):
        s = S[x:y]
        print(s)
        if all([x in 'ACGT' for x in s]):
            ret = max(ret, len(s))
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
ret = 0
for x in range(len(S)):
    for y in range(len(S)):
        s = S[x:y]
        if all([x in 'ACGT' for x in S[x:y]]):
            ret = max(ret, len(s))
print(ret)

Submission status: Wrong Answer

Solution code:
S = input()
 
len = 0
ans = 0
for ch in S:
    if ch in 'ACGT':
        len += 1
    else:
        ans = max(ans, len)
        len = 0
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
print(s.count('A')+s.count('C')+s.count('G')+s.count('T'))

Submission status: Wrong Answer

Solution code:
s=input()
print(s.count("A")+s.count("T")+s.count("G")+s.count("C"))

Submission status: Wrong Answer

Solution code:
s=input()
print(max(1,s.count("A"))+max(1,s.count("T"))+max(1,s.count("G"))+max(1,s.count("C")))

Submission status: Wrong Answer

Solution code:
a = input()
s=""
x=["A","C","T","G"]
for i in a:
  if i in x:
    s+=i
print(len(s))

Submission status: Wrong Answer

Solution code:
a = input()
s=""
x=["A","C","T","G"]
for i in a:
  if i in x:
    s+=i
print(s)

Submission status: Wrong Answer

Solution code:
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest122-B
#  https://atcoder.jp/contests/abc122/tasks/abc122_b

def solveProblem(inputString):
	stringLength = len(inputString)
	answerStringList = list()
	for i in range(0,stringLength,+1):
		for j in range(stringLength,0,-1):
			if i < j :
				searchString = inputString[i:j]
				deleteString=searchString.replace("A","").replace("C","").replace("G","").replace("T","")
				if len(deleteString)==0:
					answerStringList.append(searchString)
	maxStringLength = 0
	if len(answerStringList) != 0:
		for i in range(0,len(answerStringList)-1,+1):
			x = len(answerStringList[i])
			if maxStringLength < x:
				maxStringLength = x
	answer = maxStringLength
	return answer


if __name__ == '__main__':
	S = str(input().strip())
	solution = solveProblem(S)
	print("{}".format(solution))

Submission status: Wrong Answer

Solution code:
tmp = input()

out_1 = 0
tmp_s = []
for c in tmp:
        if c == "A" or c == "G" or c == "T" or c == "C":
                tmp_s.append(c)
        else:
                if out_1 < len(tmp_s):
                        out_1 = len(tmp_s)
                tmp_s = []
print(out_1)

Submission status: Wrong Answer

Solution code:
from sys import stdin

s = list(stdin.readline().rstrip())
acgt = ['A', 'C', 'G', 'T']

ans = 0
tmp = 0

for i in s:
    if i in acgt:
        tmp += 1
    else:
        if ans < tmp:
            ans = tmp
        tmp = 0

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
print(max(1,s.count("A"))*max(1,s.count("T"))*max(1,s.count("G"))*max(1,s.count("C")))

Submission status: Wrong Answer

Solution code:
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest122-B
#  https://atcoder.jp/contests/abc122/tasks/abc122_b

def solveProblem(inputString):
	stringLength = len(inputString)
	answerStringList = list()
	for i in range(0,stringLength,+1):
		for j in range(stringLength,0,-1):
			if i < j :
				searchString = inputString[i:j]
				deleteString=searchString.replace("A","").replace("C","").replace("G","").replace("T","")
				if len(deleteString)==0:
					answerStringList.append(searchString)
	maxStringLength = 0
	for i in range(0,len(answerStringList)-1,+1):
		x = len(answerStringList[i])
		if maxStringLength < x:
			maxStringLength = x
	answer = maxStringLength
	return answer


if __name__ == '__main__':
	S = str(input().strip())
	solution = solveProblem(S)
	print("{}".format(solution))

Submission status: Wrong Answer

Solution code:
tmp = input()

out_1 = 0
for c in tmp:
        tmp_s = []
        if c == "A" or c == "G" or c == "T" or c == "C":
                tmp_s.append(c)
        elif out_1 < len(tmp_s):
                out_1 = len(tmp_s)
                tmp_s = []
print(out_1)

Submission status: Wrong Answer

Solution code:
tmp = input()

out_1 = 0
for c in tmp:
        tmp_s = []
        if c == "A" or c == "G" or c == "T" or c == "C":
                tmp_s.append(c)
        elif out_1 < len(tmp_s):
                out_1 = len(tmp_s)

print(out_1)

Submission status: Wrong Answer

Solution code:
s=input()
print(s.count("A")*s.count("T")*s.count("G")*s.count("C"))

Submission status: Wrong Answer

Solution code:
import re

S = input()
lmax = 0

if len(S) == 1:
    l = re.findall(r'[^ACGT]', S)
    if len(l) == 0:
        lmax = 1
    else:
        lmax = 0
else:
    for i in range(len(S)):
        for j in range(1, len(S)-i):
            ss = S[i:i+j]
            l = re.findall(r'[^ACGT]', ss)
            if len(l) == 0:
                lmax = max(lmax, len(ss))
            else:
                continue
print(lmax)

Submission status: Wrong Answer

Solution code:
import re

S = input()
lmax = 0

if len(S) == 1:
    l = re.findall(r'[^ACGT]', S)
    if len(l) == 0:
        lmax = 1
else:
    for i in range(len(S)):
        for j in range(1, len(S)-i):
            ss = S[i:i+j]
            l = re.findall(r'[^ACGT]', ss)
            if len(l) == 0:
                lmax = max(lmax, len(ss))
            else:
                continue
print(lmax)

Submission status: Wrong Answer

Solution code:
import re

S = input()

lmax = 0
for i in range(len(S)):
    for j in range(0, len(S)-i):
        ss = S[i:i+j]
        l = re.findall(r'[^ACGT]', ss)
        if len(l) == 0:
            lmax = max(lmax, len(ss))
        else:
            continue
print(lmax)

Submission status: Wrong Answer

Solution code:
c=0
maxc=0
s=input()
for i in range(len(s)):
    if s[i] == "A" or "C" or "G" or "T" :
        c+=1
        if c>maxc :
            c+=1
            maxc=c
    else:
        c=0
print(maxc)

Submission status: Wrong Answer

Solution code:
S = input()

lst = []
for i in range(0, len(S)):
    for k in range(0, len(S)):
        if i > k:
            pass
        else:
            lst.append(S[i:k+1])
lst.append("")
lst_AGCT = []
for i in range(len(lst)):
    if "B" in lst[i] or "D" in lst[i] or "E" in lst[i] or "F" in lst[i] or "H" in lst[i] or "I" in lst[i] or "J" in lst[i] or "K" in lst[i] or "L" in lst[i] or "M" in lst[i] or "N" in lst[i] or "O" in lst[i] or "P" in lst[i] or "Q" in lst[i] or "R" in lst[i] or "S" in lst[i] or "U" in lst[i] or "V" in lst[i] or "W" in lst[i] or "X" in lst[i] or "Y" in lst[i] or "Z" in lst[i]:
        pass
    else:
        lst_AGCT.append(lst[i])

if lst_AGCT == [""]:
    print(0)
else:
    print(max(lst_AGCT, key=len))

Submission status: Wrong Answer

Solution code:
ansMax = 0
S = input()
strList = []
sLen = len(S)
for i in range(sLen):
    strList.append(S[i])

for i in range(sLen):
    for j in range(i, sLen):
        strList.append(S[i + j:])

for i in range(sLen):
    for j in range(i, sLen):
        strList.append(S[i:-j])

for i in strList:
    strRe = ''
    if i != '':
        strRe = i.replace('A', '')
        strRe = strRe.replace('C', '')
        strRe = strRe.replace('G', '')
        strRe = strRe.replace('T', '')
    if 0 != len(strRe):
        continue
    ansMax = max([ansMax, len(i)])

print(ansMax)

Submission status: Wrong Answer

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

Answer_list = []
DNA = ['A','T','G','C']
fragment = ''

for x in S:
  if x in DNA:
    fragment += x
    
  else:
    Answer_list.append(fragment)
    fragment = ''
Answer_list.append(fragment)
sorted_Answer_list = sorted(Answer_list)     
print(len(sorted_Answer_list[-1]))

Submission status: Wrong Answer

Solution code:
s = input().strip()
enki = set('ATCG')
count = 0
maxlen = 0
for i in range(len(s)):
    if s[i] in enki:
        count += 1
    else:
        maxlen = max(maxlen, count)
        count = 0
 
print(maxlen)

Submission status: Wrong Answer

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

Answer_list = []
DNA = ['A','T','G','C']
fragment = ''

for x in S:
  if x in DNA:
    fragment += x
    
  else:
    Answer_list.append(fragment)
    fragment = ''
Answer_list.append(fragment)
sorted_Answer_list = sorted(Answer_list)     
print(sorted_Answer_list[-1])

Submission status: Wrong Answer

Solution code:
S = input()
M1 = int(S.rfind('A') - S.find('C') + 1)
M2 = int(S.rfind('A') - S.find('G') + 1)
M3 = int(S.rfind('A') - S.find('T') + 1)
M4 = int(S.rfind('A') - S.find('A') + 1)
M5 = int(S.rfind('C') - S.find('C') + 1)
M6 = int(S.rfind('C') - S.find('A') + 1)
M7 = int(S.rfind('C') - S.find('G') + 1)
M8 = int(S.rfind('C') - S.find('T') + 1)
M9 = int(S.rfind('G') - S.find('G') + 1)
M10 = int(S.rfind('G') - S.find('C') + 1)
M11 = int(S.rfind('G') - S.find('A') + 1)
M12 = int(S.rfind('G') - S.find('T') + 1)
M13 = int(S.rfind('T') - S.find('C') + 1)
M14 = int(S.rfind('T') - S.find('A') + 1)
M15 = int(S.rfind('T') - S.find('G') + 1)
M16 = int(S.rfind('T') - S.find('T') + 1)
print(max(M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15, M16))

Submission status: Wrong Answer

Solution code:
import re

S = input()

lmax = 0
for i in range(len(S)):
    for j in range(1, len(S)-i):
        ss = S[i:i+j]
        l = re.findall(r'[^ACGT]', ss)
        if len(l) == 0:
            lmax = max(lmax, len(ss))
        else:
            continue
print(lmax)

Submission status: Wrong Answer

Solution code:
ans = 0
ans_tmp = 0
s = input()
for i in range(len(s)):
    ans_tmp = 0
    for s_bubun in s[i:]:
        if s_bubun in ("A","T","G","C"):
            ans_tmp +=1
        else:
            break
    ans = max(ans_tmp,ans)
    print(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        if all(c in 'ATCG' for c in s[i:j]):
            ans = max(ans, j - i)

print(ans)

Submission status: Wrong Answer

Solution code:
m = 0
c = 0
for s in input().strip():
    if s in "AGCY":
        c += 1
        if c > m:
            m = c
    else:
        c = 0
print(m)

Submission status: Wrong Answer

Solution code:
import re

S = input()

lmax = 0
for i in range(10):
    for j in range(1, 10-i):
        ss = S[i:i+j]
        l = re.findall(r'[^ACGT]', ss)
        if len(l) == 0:
            lmax = max(lmax, len(ss))
        else:
            continue
print(lmax)

Submission status: Wrong Answer

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

if len(t)==0:
    print(len(s))
else:
    print(max(t))

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        if all(c in 'ATCG' for c in s[i:j]):
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

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

def findLength(index):
    length = 0
    for c in s[index:]:
        if c in arr:
            length +=1
        else:
            break
    return length

max_length = 0
for i in range(0, len(s)-1):
    L = findLength(i)
    max_length = max(max_length, L)
    

print(max_length)

Submission status: Wrong Answer

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

if len(t)==0:
    print(len(s))
else:
    print(max(t))

Submission status: Wrong Answer

Solution code:
#coding: utf-8
S = input()
enki = ["A", "T", "G", "C"]
a = []
ans = ""
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
    else:
        ans = " "
    a.append(ans)
print(len(max(a)))

Submission status: Wrong Answer

Solution code:
import re
S = input()
s = ''
for x in S:
    if x in 'ACGT':
        s += '1'
    else:
        s += '0'

a = re.search(r'(1)+',s)
if a is None:
    print(0) 
else:            
    print(len(a.group()))

Submission status: Wrong Answer

Solution code:
S = input()
ACGT = ["A","C","G","T"]
index = []
for i in range(len(S)):
    if S[i] not in ACGT:
        index.append(i)

if index:
    diff = [index[0]]
    for j in range(len(index)-1):
        diff.append(index[j+1] - index[j] - 1)
    print(max(diff))

else:
    print(len(S))

Submission status: Wrong Answer

Solution code:
s = input()

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

def findLength(index):
    length = 0
    global arr
    global s
    
    for c in s[index:-1]:
        if c in arr:
            length +=1
        else:
            break
    return length

max_length = 0
for i in range(0, len(s)-1):
    max_length = max(max_length, findLength(i))
print(max_length)

Submission status: Wrong Answer

Solution code:
s = input()

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

def findLength(index):
    length = 0
    global arr
    global s
    
    for c in s[index:-1]:
        if c in arr:
            length +=1
        else:
            break
    return length

max_length = 0
for i in range(0, len(s)-1):
    max_length = max(max_length, findLength(i))


print(max_length)

Submission status: Wrong Answer

Solution code:
S = input()

ns = [0]
n = 0
for s in S:
    if s in 'ACGT':
        n += 1
    else:
        ns.append(n)
        n = 0

print(max(ns))

Submission status: Wrong Answer

Solution code:
list=[]
c=0
maxc=0
s=input()
for i in range(len(s)):
    list.append(s[i])
for j in range(len(s)):
    if list[j] == "A"or"C"or"G"or"T" :
        c+=1
        if c>maxc :
            maxc=c
        else:
            next
    else:
        c=0
print(maxc)

Submission status: Wrong Answer

Solution code:
import re
S = input()
L = len(S)
mlen = 0

match = re.search('[ATGC]+', S)
#print(match.span())
try:
  print(match.span()[1] - match.span()[0])
except:
  print(0)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

string = list(input())
print(string)
num = 0
for i in range(len(string)):
    if string[i] == "A" or string[i] == "T" or string[i] == "G" or string[i] =="C":
        num += 1
print(num)

Submission status: Wrong Answer

Solution code:
S = input()
sum = 0
maxsum = 0
for i in range(len(S)):
    if S[i] in "ACGT":
        sum +=1
    else:
        if maxsum < sum:
            maxsum = sum
        sum = 0
print(maxsum)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
S = input()
enki = ["A", "T", "G", "C"]
a = []
ans = ""
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
    else:
        ans = ""
    a.append(ans)
print(len(max(a)))

Submission status: Wrong Answer

Solution code:
a = input()
a=a.replace("T","A")
a=a.replace("C","A")
a=a.replace("G","A")
max =1
cnt =1
for i in range(len(a)-1):
  if a[i] == a[i+1] and "A":
    cnt+=1
    if cnt > max:
      max = cnt
    else:
      cnt = 1
print(max)

Submission status: Wrong Answer

Solution code:
S = input()
S_list = list(S)
answers = []
acgt = 0
for s in S_list:
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        acgt += 1
    else:
        answers.append(acgt)
        acgt = 0
if answers:
    print(max(answers))
else:
    print(acgt)

Submission status: Wrong Answer

Solution code:
import re
print(len(max(re.compile(r'[A|G|C|T]*').findall(input()))))

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
max_count = 0
for s_char in S:
    if s_char == 'A' or s_char == 'C' or s_char == 'G' or s_char == 'T':
        count += 1
    else:
        max_count = max(max_count, count)
        count = 0
if count == len(S):
    max_count = count
print(max_count)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
biggest = 0
for i in range(n):
  count = 0
  for j in range(i+1):
    if s[j] == "A":
      count += 1
    elif s[j] == "T":
      count += 1
    elif s[j] == "G":
      count += 1
    elif s[j] == "C":
      count += 1
      if count > biggest:
        biggest = count
    else:
      break
print(biggest)

Submission status: Wrong Answer

Solution code:
s=input()
l=list(s)
m=0
for i in range(len(l)):
    if l[i]!="A" and l[i]!="T" and l[i]!="C" and l[i]!="G":
        l[i]="."

print(l)
ss="".join(l)
ll=ss.split(".")
lll=[0]
for i in ll:
    lll.append(len(i))
print(max(lll))