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).

Solution (Python):
s = input() + '0'
det = 'ACGT'
maxc = 0
for i in range(len(s)):
    for p in range(i, len(s)):
        cnt = 0
        for o in range(i, p + 1):
            if s[o] in det:
                cnt += 1
            else:
                if cnt > maxc:
                    maxc = cnt
                    break
                else:
                    break
            if o == p:
                if cnt > maxc:
                    maxc = cnt
print(maxc)

Solution (Python):
acgt = ["A", "C", "G", "T"]
s = input()
cnt = 0
cnt_max = 0
for c in list(s):
  if c in acgt:
    cnt += 1
  else:
    if cnt > cnt_max:
      cnt_max = cnt
    cnt = 0
if cnt > cnt_max:
      cnt_max = cnt
print(cnt_max)

Solution (Python):
def diff(tmp):
    if tmp > cnt:
        return tmp
    else:
        return  cnt

list = list(input())

cnt = 0
tmp = 0
for row in list:
    if row in ('ACGT'):
        tmp += 1
        cnt = diff(tmp)
    else:
        cnt = diff(tmp)
        tmp = 0

print(cnt)

Solution (Python):
S = input()
start = 0
max = 0
count = 0
for i in range(len(S)):
    if(S[i] != "A")&(S[i] != "T")&(S[i] != "G")&(S[i] != "C"):
        if max < count:
            max = count
        count = 0
    else:
        count = count + 1
if ((S[i] == "A")|(S[i] == "T")|(S[i] == "G")|(S[i] == "C"))&(max < count):
    max = count
print(max)

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

li_otpt = [0]
for s in S:
  if s in l:
    li_otpt[-1] += 1
  else:    
    li_otpt.append(0)
      
print(max(li_otpt))

Solution (Python):
l = ["A","T","C","G"]
S = input()
tmp = ""
ans = 0
for s in S:
  if not s in l:
    ans = max(ans,len(tmp))
    tmp = ""
  else:
    tmp += s
ans = max(ans,len(tmp))
print(ans)

Solution (Python):
S = input()
len_S = len(S)

results = []
begin, end = None, None
acgt = 'ACGT'
for i, s in enumerate(S):
  if begin is None and s in acgt:
    begin = i
  
  if begin is not None and s not in acgt:
    end = i
  
  if begin is not None and (end is not None or i == len_S - 1):
    if end is None:
      end = len_S
    results.append(end - begin)
    begin, end = None, None

print(max(results) if len(results) > 0 else 0)

Solution (Python):
str = input()

def check(text):
  if text=='A' or text=='G' or text=='C' or text=='T':
    return 1
  else:
    return 0

longest=0
sum=0
str=str+'B'
for i in str:
  if check(i)==1:
    sum+=1
  else:
    if longest<sum:
      longest=sum
      sum=0
    else:
      sum=0
print(longest)

Solution (Python):

S=str(input())
Slist=list(S)
Slen=len(Slist)
MAX=0
for i in range(Slen):
    for j in range(Slen-i-1):
        J=j+i+1
        karis=Slist[i:J+1]
        flag = 0
        for x in karis:
            if x == "A" or x == "T" or x == "C" or x == "G":
                pass
            else:
                flag = 1
                break
        if flag == 0:
            MAX=max(MAX,len(karis))
if MAX == 0:
    if "A" in S or "T" in S or "G" in S or "C" in S:
        print(1)
    else:
        print(0)
else:
    print(MAX)

Solution (Python):
S=input()
A=list(S)
number=[]
for i in A:
    if i == "A" or i == "C" or i == "G" or i == "T":
        number.append(1)
    else:
        number.append(0)

count=0
maxcount=0

for i in number:
    if i == 1:
        count = count + 1
        if count > maxcount:
            maxcount=count
    elif i == 0:
        count = 0
        
print(maxcount)

Solution (Python):
s = input()

l = ["A","C","G","T"]
res = 0

for i in range(len(s)):
    
    tmp = 0
    
    for j in s[i:]:
        if j in l:
            tmp += 1
        else:
            res = max(res,tmp)
            
            break
    else:
        res = max(res,tmp)
else:
    print(res)

Solution (Python):
Ss=[i for i in input()]
anss = []
counter = 0
for i in range(len(Ss)):
    if Ss[i]!="A" and Ss[i]!="C" and Ss[i]!="G" and Ss[i]!="T":
        anss.append(counter)
        counter=0
    else:
        counter+=1
        anss.append(counter)
if len(anss)!=0:
    print(max(anss))
else:
    print(0)

Solution (Python):
S = input()

max_ss = 0
current_size = 0

for i in range(0,len(S)):
  
  if S[i] in ['A','G','C','T']:
    current_size += 1
    
  else:
    max_ss=max(max_ss,current_size)
    current_size=0

max_ss=max(max_ss,current_size)

print(max_ss)

Solution (Python):
S = input()

count = 0
max_length = 0
for i in S:
    if i in ('A', 'T', 'C', 'G'):
        count += 1
        if count > max_length:
            max_length = count
    else:
        count = 0

print(max_length)

Solution (Python):
S = input()
tmp = 0
ans = 0
index = 0
while index != len(S):
    if S[index] == "A" or S[index] == "T"  or S[index] == "G" or S[index] == "C":
        tmp += 1
    else:
        if tmp > ans:
            ans = tmp
        tmp = 0
    index += 1
if tmp > ans:
    ans = tmp
print(ans)

Solution (Python):
b = raw_input()
N = len(b)


score=0
tmp_score=0

for i in range(N):
	for c in range(N+1):
		if b[i:i+c].count('A')+b[i:i+c].count('C')+b[i:i+c].count('G')+b[i:i+c].count('T') == len(b[i:i+c]):
			tmp_score = len(b[i:i+c])

			if score<tmp_score:
				score=tmp_score
print score

Solution (Python):
S = input()
import re
regex = re.compile(r"[ATGC]+")
mo = regex.findall(S)
l=[]
for item in mo:
    l.append(len(item))
if l ==[]:
    print("0")
else:
    print(max(l))

Solution (Python):

"""
Created on Sun Mar 24 17:18:46 2019
ABC122B
@author: maezawa
"""

s = input()
n = len(s)
cnt = 0
atcgset = set(['A','T','C','G'])
for i in range(n):
    for j in range(i,n):
        subs = s[i:j+1]
        
        sset = set(s[i:j+1])
        if atcgset >= sset:
            
            if len(subs) > cnt:
                cnt = len(subs)
print(cnt)

Solution (Python):

s = input()
a = [0] *len(s)
for i in range(len(s)):
    for j in range(len(s) - i):
        if s[i+j: i+j+1] == "A" or s[i+j: i+j+1] == "T" or s[i+j: i+j+1] == "C" or s[i+j: i+j+1] == "G":
            a[i] += 1
        else:
            break
        
print(max(a[i] for i in range(len(s))))

Solution (Python):
import re
S = input()

pattern = '[A|C|G|T]+'


results = re.findall(pattern, S, re.S)

if len(results) == 0 :
    print(0)
else :
    print(len(max(results,key=len)))

Solution (Python):

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

Solution (Python):
s = input()
ans = 0
n = 0

for i in range(len(s)):
        if s[i] in 'ACGT':
                n = n + 1
        else:
                n = 0
        if ans < n:
                ans = n
print(ans)

Solution (Python):
S = input()
enki = {"A", "T", "C", "G"}
T = list(S)
l = [0] * 10
for i in range(len(T)):
    j = i
    while(j<len(T) and T[j] in enki):
        l[i] += 1
        j += 1

print(max(l))

Solution (Python):
b = input()
list = ['A','C','G','T']
count = 0
max = 0
for i in b:
    if i in list:
        count = count+1
    else:
        if max < count:
            max = count
        count = 0
if max < count:
    print(count)
else:
    print(max)

Solution (Python):
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)
    cnt = 0

L.append(cnt)

if len(L) == 0:
	print(0)
else:
	print(max(L))

Solution (Python):
import numpy as np
S = input()
spl = list(S)
alpha_set = ['A', 'T', 'G', 'C']
x = np.zeros(len(S))
for i in range(len(S)):
  if len(set(alpha_set)-set(spl[i]))==4:
    x[i] = 0
  else:
    x[i] = 1
count = 0
answer = 0
for i in range(len(x)):
  if x[i]==1:
    count += 1
    if answer<count:
      answer = count
  else:
    count = 0
print(answer)

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

Solution (Python):
s = input()
ans = 0
tmp = ''
atgc = ['A', 'T', 'G', 'C']
kosu = 0

for mae in range(len(s)):
    for ato in range(len(s)):
        tmp = s[mae:ato+1]
        kosu = 0
        for cnt in range(len(tmp)):
            if tmp[cnt] in atgc:
                kosu += 1
            if kosu == len(tmp) and len(tmp) > ans:
                ans = len(tmp)

print(ans)

Solution (Python):


 
S = input()
count = 0
count_max = 0
 
for i in S : 
    if (i == "A" or i == "T" or i == "G" or i == "C") :
        count += 1
        count_max = max(count_max, count)
    else : 
        count = 0
        
print(count_max)

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

Solution (Python):

S = input()
ans = 0
for l in range(len(S)):
    for r in range(1, len(S) + 1):
        if l < r and all(S[k] in list('ACGT') for k in range(l, r)):
            ans = max(ans, r - l)
print(ans)

Solution (Python):
def length(strings):
  N = len(strings)
  dp = [0 for _ in range(N)]
  max_l = [0 for _ in range(N)]
  i = 0
  if strings[i] in ["A", "C", "G", "T"]:
    dp[i] = 1
  else:
    dp[i] = 0 
  max_l[i] = dp[i]
  for i in range(1, N, 1):
    if strings[i] in ["A", "C", "G", "T"]:
      dp[i] = dp[i-1] + 1
    else:
      dp[i] = 0
    max_l[i] = max(max_l[i-1], dp[i])
    
  return max_l[N-1]

if __name__ == "__main__":
  string = input()
  print(length(string))

Solution (Python):
s = input()
p = []

ans = 0
ansp = []

for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        p.append(1)
    else:
        p.append(0)
lenp = len(p)

for ii in range(20):
    for j in range(len(p)):
        if p[j] == 1:
            ans = ans + 1
        else:
            break
    ansp.append(ans)
    ans = 0

    if len(ansp) == lenp:
        break

    del p[0]

print(max(ansp))

Solution (Python):
import re

pattern = '[^ACGT]'
S = input()
ans = max(map(len, re.split(pattern, S)))
print(ans)

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    S = [str(c) for c in input().strip()]

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
S=str(input())
import re
n=len(list(S))
result=re.findall('[A,C,G,T]{1,10}',S)
try:
    
    result=max(result,key=len)
    print(len(result))
except:
    print(0)

Solution (Python):


str = input()
x = len(str)
count = 0
tmp_c = 0

for i in range(x):
    if str[i:i+1] == 'A' or str[i:i+1] == 'T' or str[i:i+1] =='C' or str[i:i+1] == 'G':
        tmp_c = tmp_c + 1
    else:
        if count < tmp_c:
            count = tmp_c
        tmp_c = 0

    if i+1 == x:
        if count < tmp_c:
            count = tmp_c
        break

print(count)

Solution (Python):
S=input()
l=len(S)
s=0
e=0
L=0
max=0
for i in range(l):
	if S[i]=="A" or S[i]=="T" or S[i]=="G" or S[i]=="C":
		L=L+1
		if L>max:
			max=L
	else:
		L=0
print(max)

Solution (Python):
S = input()
list = ["A","C","G","T"]
result = 0
count = 0
for i in range(len(S)):
    if S[i:i+1] in list:
        count += 1
    elif count > result:
        result = count
        count = 0
if count > result:
    result = count
print(result)

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

Solution (Python):
S=input()
l=["A","T","C","G"]
ans=0
for i in range(len(S)):
  for j in range(i,len(S)):
    if all(S[k] in l for k in range(i,j+1)):
      ans=max(ans,j-i+1)
print(ans)

Solution (Python):
string_list = list(input())
string_len = len(string_list)
renzoku_list = []

def find_letter():
  renzoku = 0
  for i in range(string_len):
    if string_list[i]=='A':
      renzoku += 1
    elif string_list[i]=='C':
      renzoku += 1
    elif string_list[i]=='G':
      renzoku += 1
    elif string_list[i]=='T':
      renzoku += 1
    else:
      renzoku_list.append(renzoku)
      renzoku = 0
  renzoku_list.append(renzoku)

find_letter()
  
if renzoku_list:
  max_len = max(renzoku_list)
  print(max_len)
else:
  print(0)

Solution (Python):
s = input()
s = list(s)
cnt = []
for i in range(len(s)):
  c = 0
  j = i
  while s[j] == 'A' or s[j] == 'T' or s[j] == 'C' or s[j] == 'G':
    c +=1
    j += 1
    cnt.append(c)
    if j == len(s):
      break
if not cnt:
  print(0)
else:
  print(max(cnt))

Solution (Python):
b=list(input())
N=len(b)
enki=["A","T","G","C"]
curmax=0
for i in range(N):
    for j in range(i,N):
        if all((k in enki) for k in b[i:j+1]):
            curmax=max(curmax,j-i+1)
print(curmax)

Solution (Python):
s = input()

N = len(s)
i = 0
a = ""
while i<N:
	
	if s[i]=="A" or s[i]=="T" or s[i]=="C" or s[i]=="G":
		a = a + "A"
	else:
		a = a + ","
	i += 1


l=a.split(",")



ans=0
for b in l:
	ans = max(len(b),ans)

print(ans)

Solution (Python):
s = input()
counter = 0
ans = 0
len = len(s)
for i in range(len):
    if s[i] == "A":
        counter += 1
    elif s[i] == "T":
        counter += 1
    elif s[i] == "G":
        counter += 1
    elif s[i] == "C":
        counter += 1
    else:
        if counter > ans:
            ans = counter
        
        counter = 0

if counter > ans:
    ans = counter
    
print(ans)

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

Solution (Python):
S=input()
judge=''
L=len(S)
for index in range(L):
    moji=S[index]
    if (moji=='A') or (moji=='G') or (moji=='T') or (moji=='C'):
        judge+='X'
    else:
        judge+='W'

num_keeper=[]
num=0
for index in range(L):
    J=judge[index]
    if (index==0) and (J=='X'):
        num=1
    elif J=='W':
        num_keeper.append(num)
        num=0
    elif (index==L-1) and (J=='X'):
        num+=1
        num_keeper.append(num)
    else:
        num+=1
if len(num_keeper)==0:
    num_keeper.append(L)
print(max(num_keeper))

Solution (Python):

S = input()

n = 0
best_n = 0
length = len(S)

for i in range(length):
    if (S[i] in ['A', 'C', 'G', 'T']):
        n += 1
        if (i == length - 1) and (n > best_n):
            best_n = n
    else:
        if (n > best_n):
            best_n = n
            n = 0
print(best_n)

Solution (Python):
def main():
    a = ['A', 'T', 'G', 'C']
    S = input()
    l = 0
    L = 0
    for s in S:
        if s in a:
            l += 1
        else:
            if l > L:
                L = l
            l = 0
    if l > L:
        L = l
    print(L)


if __name__ == '__main__':
    main()

Solution (Python):
a = input()
a = a.replace("A","*")
a = a.replace("C","*")
a = a.replace("G","*")
a = a.replace("T","*")
if (a.find("**********")!=-1):
    print("10")
elif(a.find("*********")!=-1):
    print("9")
elif(a.find("********")!=-1):
    print("8")
elif(a.find("*******")!=-1):
    print("7")
elif(a.find("******")!=-1):
    print("6")
elif(a.find("*****")!=-1):
    print("5")
elif(a.find("****")!=-1):
    print("4")
elif(a.find("***")!=-1):
    print("3")
elif(a.find("**")!=-1):
    print("2")
elif(a.find("*")!=-1):
    print("1")
else:
    print("0")

Solution (Python):
if __name__ == '__main__':
  str = input()
  l = list(str)
  counter = 0
  max = 0
  for s in l:
    if s == 'A' or s == 'G' or s == 'C' or s == 'T':
      counter += 1
      if max <= counter:
        max = counter
    else:
      counter = 0
  print(max)

Solution (Python):
S = input()
max = 0
import re
for i in range(len(S)):
    for j in range(i+1, len(S)+1):
        if re.search("[^ATCG]", S[i:j]):
            pass
        else:
            if max < len(S[i:j]):
                max = len(S[i:j])
print(max)

Solution (Python):
s = input()

maxLength = 0

tempLength = 0

for letter in s:
  if letter in "AGCT":
    tempLength += 1
    if tempLength > maxLength:
      maxLength = tempLength
  else:
    tempLength = 0

print(maxLength)

Solution (Python):
S = input()
li = [-1]
ans = 0
for index,i in enumerate(S):
    if(i!='A' and i!='C' and i!='G' and i!='T'):
        li.append(index)
li.append(len(S))
if(len(li)==1):
    print(len(S))
else:
    for index,i in enumerate(li):
        if(not index==0):
            ans = max(ans,li[index]-li[index-1]-1)

    print(ans)

Solution (Python):
S = input()

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

count = 0
ans = 0
for s in S:
    if s in sub_str:
        count += 1
    else:
        ans = max(ans, count)
        count = 0
else:
    ans = max(ans, count)
print(ans)

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

Solution (Python):

S = str(input())

max_len = 0

for i in range(len(S)):
    for j in range(i, len(S)):
        compared_str = compared_str = S[i : j+1]
        compared_str = compared_str.replace('A', '')
        compared_str = compared_str.replace('C', '')
        compared_str = compared_str.replace('G', '')
        compared_str = compared_str.replace('T', '')
        
        if compared_str == '':
            max_len = max([max_len, len(S[i : j+1])])
        
print(max_len)

Solution (Python):

S = list(input())
ACGT = []
lentemp = 0
while len(S)>0:
    s = S.pop(0)

    if s == "A" or s == "C" or s == "G" or s == "T":
        lentemp += 1

    else:
        ACGT.append(lentemp)
        lentemp = 0
ACGT.append(lentemp)

print(max(ACGT))

Solution (Python):
def main():
    s = input()

    ans = 0
    for i in range(len(s)):
        for j in range(i+1, len(s)+1):
            ok = True
            ss = s[i:j]
            for k in ss:
                if k not in {"A", "C", "G", "T"}:
                    ok = False

            if ok:
                ans = max(ans, j-i)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
y = input()
ans = 0
count = 0
c = 0
for i in y:
    c += 1
    if i == 'A' or i == 'C' or i == 'T' or i == 'G':
        count += 1
        if c == len(y):
            if ans < count:
                ans = count
    else:
        if ans < count:
            ans = count
        count = 0

print(ans)

Solution (Python):
n=input()
ans=0
anss=[]
for i in range(len(n)):
    
    if n[i] == "A" or n[i] == "T" or n[i] == "G" or n[i] == "C":
        ans += 1
        anss.append(ans)
    else:
        anss.append(ans)
        ans=0

import numpy as np
anss=np.array(anss)
print(anss.max())

Solution (Python):
a = input()
lis = []
li = ["A","C","G","T"]
l = []
for i in range(len(a)):
    if a[i] in li:
        lis.append(a[i])
        if i == len(a)-1:
            l.append(lis)
    else:
        l.append(lis)
        lis = []
ans = 0
for n in l:
    if ans < len(n):
        ans = len(n)
print(ans)

Solution (Python):
import re

istr=input()

print(max([len(e) for e in re.split('[BDEFHIJKLMNOPQRSUVWXYZ]',istr)]))

Solution (Python):
s = list(input())
acgt = ['A', 'C', 'G','T']
lst = []
for c in s:
    if c in acgt:
        lst.append(c)
    else:
        lst.append(" ")
ans = "".join(lst).split()
ln = list(map(len, ans))
if len(ln) > 0:
    print(max(ln))
else:
    print(0)

Solution (Python):
S = input()

cntMax = 0
cnt = 0

for s in S:
    
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        cnt += 1
    else:
        cntMax = max(cntMax, cnt)
        cnt = 0

cntMax = max(cntMax, cnt)

print(cntMax)

Solution (Python):
S = input()
ch = ['A','C','G','T']

ans = 0
for i in range(len(S)):
    for j in range(i+1,len(S)+1):
        s = S[i:j]
        flag = 0
        for ss in s:
            if not (ss in ch):
                flag = 1
                break
        if flag == 0:
            ans = max(ans, len(s))

print(ans)

Solution (Python):
S = input()
atcg_length = 0 
tmp_length = 0 
for i in range(len(S)): 
    if S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or  S[i] == 'G':
        tmp_length += 1
        atcg_length = max(atcg_length, tmp_length)
    else:
        tmp_length = 0
print(atcg_length)

Solution (Python):
b=input()
ACGT=["A","C","G","T"]
ans=[0 for i in range(len(b))]
a=0
for i in b:
	if i in ACGT:
		ans[a]=ans[a]+1
	else:
		a=a+1
ans.sort(reverse=True)
print(ans[0])

Solution (Python):
import re

S = input()
ans = re.split(r'[^ATGC]', S)

maxlen = -1
maxarg = 0
for a in ans:
    maxlen = len(a) if len(a) > maxlen else maxlen

print(maxlen)

Solution (Python):
inp = input()

max_len = 0
list_match = []

for i in inp:
  if i in ('A','T','G','C'):
    list_match.append(1)
  else:
    list_match.append(0)



for i in range(len(list_match)):
  cnt_char = 0
  if list_match[i] == 1:
    cnt_char += 1
    
    for _j in range(len(list_match)):
      if i + 1 == len(list_match):
        break
      elif list_match[i+1] == 1:
        cnt_char += 1
        i += 1
      else:
        break      
    
    if max_len < cnt_char:
      max_len = cnt_char
      
print(max_len)

Solution (Python):

import sys
import collections

def main():
	S = input()
	S = list(S)
	
	ans = 0
	for i, vol in enumerate(S):
		tmp = 0
		if vol == "A" or vol == "C" or vol == "G" or vol == "T":
			tmp += 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":
					tmp += 1
				else:
					break
			if ans < tmp:
				ans = tmp
			
		
	
	print(ans)
			
if __name__ == "__main__":
	main()

Solution (Python):
S = input()
count = 0
x = [0]

for i in S:
  if i in ('A','C','G','T'):
    count += 1
  else:
    x.append(count)
    count = 0
x.append(count)

print(max(x))

Solution (Python):

string = input()
pattern = ["A","C","G","T"]

c = 0
result = []
for i in string:
    if i in pattern:
        c += 1
        if string[len(string)-1] == i:
            result.append(c)
    else:
        result.append(c)
        c = 0

if len(result) == 0:
    print(len(string))
else:
    print(max(result))

Solution (Python):
S = input()

S = list(S)

for i in range(len(S)):	
	if not (S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G'):
		S[i] = ","
		
S = ("".join(S)).split(",")
print(max([len(s) for s in S]))

Solution (Python):
S = input()
ans = 0
for i in range(len(S)):
    for j in range(i + 1, len(S) + 1):
        T = S[i:j]
        cnt = 0
        for x in T:
            if x not in ['A', 'T', 'G', 'C']:
                break
            cnt += 1
        ans = max(ans, cnt)
print(ans)

Solution (Python):
S = list(input())
answer = 0

for i in range(len(S)):
    counter = 0
    for j in range(i,len(S)):
        if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
            counter += 1  
            if j == len(S)-1:
                if counter > answer:
                    answer = counter
        else:
            if counter > answer:
                answer = counter
            break
print(answer)

Solution (Python):
S = input()
S = list(S)
cnt = 0
maxcount = 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
        if cnt > maxcount:
            maxcount = cnt
    else:
        cnt = 0
print(maxcount)

Solution (Python):
S = ['A', 'C', 'G', 'T'] 
s = input()
ans = 0
for i in range(len(s)):
    if s[i] in S:
        for j in range(len(s)-i):
            if s[i+j] in S:
                ans = len(s[i:i+j+1]) if ans < len(s[i:i+j+1]) else ans
            else:
                break

print(ans)

Solution (Python):

a = [str(i) for i in input()] 
max=0
ans=0


for i in range(len(a)):

    if a[i] == "A" or a[i] == "C" or a[i] == "G" or a[i] == "T":
        max=max+1
    else:
        if(ans <= max):
            ans=max
            max=0
        
        
if(ans <= max):
    ans=max

if ans >= 11:
    ans=10
    
print(ans)

Solution (Python):
import sys
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

S = read_str()

def solve():
    res = [0 for _ in range(10)]
    index = 0
    for i in range(len(S)):
        if S[i] in ['A','T','G','C']:
            res[index] += 1
        else:
            index += 1
    print(max(res))

if __name__ == "__main__":
    solve()

Solution (Python):
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)

Solution (Python):
h = input()
S = list(h)

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

flag = False
count = 0
maxt = 0
for i in range(len(S)):
    for s in range(len(S)):
        s = s + i
        if len(S) <= s:
            if maxt <= count:
                maxt = count
            break
        if flag == False and (S[s] in atc):
            flag = True
            count += 1
        elif flag == True and (S[s] in atc):
            count += 1
        elif flag == True:
            break
        if maxt < count:
            maxt = count
    count = 0
    flag = False
print(maxt)

Solution (Python):

S=input()


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

Solution (Python):
S = input()
ans = 0
for i in range(len(S),0,-1):
    for j in range(len(S)-i+1):
        flag = True
        for c in S[j:j+i]:
            if c not in ["A","T","C","G"]:
                flag = False
        if flag:
            ans = max(ans,i)
print(ans)

Solution (Python):
import re

s = input()
print(max((len(m.group(0)) for m in re.finditer("[ACGT]+", s)), default=0))

Solution (Python):
S = input()

count = 0
C = []
for i in range(len(S)):
  C.append(count)
  count = 0
  if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
    count += 1
    if(i == len(S)-1):
      C.append(count)
      break
    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

print(max(C))

Solution (Python):
S = list(input())


for i in range (len(S)):
    if S[i] == "A":
        S[i] = "1"
    elif S[i] == "G":
        S[i] = "1"
    elif S[i] == "C":
        S[i] = "1"
    elif S[i] == "T":
        S[i] = "1"

S2 = "".join(S)

for i in range (len(S)+1)[::-1]:
    A = "".join("1" * i)
    if A in S2:
        print(i)
        break

Solution (Python):






S = str(input())





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





count = 0
ans = 0





for i in range(len(S)):
    if S[i] in acgt:
        count += 1
        if ans < count:
            ans = count
    else:
        count = 0

print(ans)

Solution (Python):
s=input()
l=len(s)
max=0
Max=0
i=0
while i < l:
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        i+=1
        max+=1
    else:
        i+=1
        if max>Max:
            Max=max
        max=0
if max>Max:
    Max=max
print(Max)

Solution (Python):
S = input()
count = 0
ans = 0
for s in S:
    if s in "ACGT":
        count += 1
    else:
        if ans < count:
            ans = count
        count = 0
    if ans < count:
        ans = count
        
print(ans)

Solution (Python):
l=input()
a='AGCT'
cnt=0;max=0
for i in l:
    if i in a:
        cnt+=1
        if max < cnt:
            max=cnt
    else:
        cnt=0
print(max)

Solution (Python):
S = input()
base = ['A', 'T', 'C', 'G']

n = len(S)
st = 0
ans = 0
for i in range(n):
    if S[i] in base:
        ans = max(ans, i - st + 1)
        continue
    ans = max(ans, i - st)
    st = i + 1

print(ans)

Solution (Python):
b = input()

count = 0
max_count = 0
for s in b:
  if s == "A" or s == "C" or s == "G" or s == "T":
    count += 1
  else:
    if max_count < count:
      max_count = count
    count = 0
if max_count == 0 or max_count < count:
  	max_count = count
print(max_count)

Solution (Python):
n = input()

ls = []
cnt = 0
for i in range(len(n)):
  if n[i] == 'A' or n[i] == 'G' or n[i] == 'C' or n[i] == 'T':
    cnt += 1
    ls.append(cnt)
  else:
    cnt = 0
    ls.append(cnt)
    
print(max(ls))

Solution (Python):
import re
from functools import reduce

print(reduce(lambda x, y: max(x, y), map(lambda x: len(x), re.split('[^ATGC]', input()))))

Solution (Python):
n=input()
n=list(n)

n1=[0 for i in range(len(n))]
for i in range(len(n)):
    if n[i]=='A' or n[i]=='C' or n[i]=='G' or n[i]=='T':
        n1[i]=1


cnt=0
maxcnt=0
for i in n1:
    if i==1:
        cnt+=1
        maxcnt=max(maxcnt,cnt)
    else:
        cnt=0
        
print(maxcnt)

Solution (Python):
s = input()
cs = [c in {'A', 'T', 'C', 'G'} for c in s]

q = 0
for i, c in enumerate(cs):
    p = 0
    if c:
        for j in range(i, len(cs)):
            if not cs[j]:
                break
            p += 1
        if q == 0 or q < p:
            q = p

print(q)

Solution (Python):
n = input()
co = 0
max = 0
for i in range(len(n)) :
    if n[i] == "A" or n[i] == "T" or n[i] == "G" or n[i] == "C" :
        co += 1
    else :
        if co >= max :
            max = co
        co = 0
if co >= max :
    max = co
print(max)

Solution (Python):
s=input()
num = 0
maxi = 0
for i in s:
  if i=="A" or i=="T" or i=="G" or i=="C":
    num += 1
  else : num = 0
  if num > maxi:
    maxi = num
print(maxi)

Solution (Python):
s = list(input())
renzoku = 0
count = 0
hu_renzoku = 0
renli = []
for i in s:
    count += 1
    if i == "A" or i == "T" or i == "C" or i == "G":
        renzoku += 1
        renli.append(renzoku)
    else:
        renzoku = 0
        hu_renzoku += 1
if count == hu_renzoku:
    print(0)
else:
    print(max(renli))

Solution (Python):
s = input()

count = 0
ans = 0

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

print(ans)

Solution (Python):
a = ['A', 'C', 'G', 'T']
s = list(input())
result = 0
count = 0
for c in s:
    if c in a:
        count += 1
    else:
        if result < count:
            result = count
        count = 0
if result < count:
    result = count
print(result)

Solution (Python):
a = input()

part = ""
s = ["A","C","G","T"]
ans = [""]

for i in a:
    
    if  i  in s:
        part += i
    else:
        part = ""
    ans.append(part)
ans = [len(i) for i in ans]
print(max(ans))