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

len_s = len(S)
bases = ('A', 'C', 'G', 'T')

ans = 0
cnt = 0

for i in range(len_s):
  if S[i] in bases:
    cnt += 1
  else:
    ans = max(ans, cnt)
    cnt = 0
if cnt > 0:
  ans = max(ans, cnt)
print(ans)

Solution (Python):
S = input()

ans = 0
tmp = 0
flag = False

for i in S:
    if (i == "A") or (i == "C") or (i == "G") or (i == "T"):
        tmp += 1
        flag = True
    elif (tmp > ans) and flag:
        ans = tmp
        tmp = 0
        flag = False
    elif flag:
        tmp = 0
        flag = False

if (ans < tmp):
    ans = tmp

print(ans)

Solution (Python):
def rensa(s,i):
    a=["A","C","G","T"]
    num=i+1 
    l=len(s)
    check=0
    combo=1
    while check==0 and num<=l-1:
        if any(s[num]==a[j] for j in range(4)):
            combo+=1
            num+=1
        else:
            check=1
    return combo

s=input()
l=len(s)
a=["A","C","G","T"]
max=0
for i in range(l):
    if any(s[i]==a[j] for j in range(4)):
        combo=rensa(s,i)
        if combo>max:
            max=combo
print(max)

Solution (Python):
s=input()
max=0
cnt=0
for _ in s:
    if _ in ['A','G','T','C']:
        cnt+=1
        if max < cnt:
            max = cnt
    else:
        cnt=0
print(max)

Solution (Python):
S = input()

ans = 0
ans_m = 0
for s in S:
    if s in ["A","C","G","T"]:
        ans += 1
        if ans > ans_m:
            ans_m = ans
    else:
        ans = 0

print(ans_m)

Solution (Python):
s = input()
acgt = {'A','C','G','T'}
max_len = 0
count=0
for si in s:  
  if si in acgt:
    count+=1
    if max_len < count :
      max_len = count    
  else:
    count=0
print(max_len)

Solution (Python):
a = input()
b = ["A","C","G","T"]
c = 0
d = [0]

for s in a:
  if s in b:
    c += 1
    d.append(c)
  else:
    c = 0
    d.append(c)
else:
  print(max(d))

Solution (Python):
S = list(input())
acgt = ['A', 'C', 'G', 'T']
lengths = []
l = 0
for x in S:
  if x in acgt:
    l += 1
  else:
    lengths.append(l)
    l = 0

if len(lengths) == 0 or l > 0:
  lengths.append(l)

print(max(lengths))

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

Solution (Python):
n = input()
max = 0
temp = 0
for str in n:
    if str in 'ACGT':
        temp += 1
        if max < temp:
            max = temp
    else:
        temp = 0
print(max)

Solution (Python):
n = input()
max = 0
temp = 0
for str in n:
    if str == 'A' or str == 'T' or str == 'C' or str == 'G':
        temp += 1
        if max < temp:
            max = temp
    else:
        temp = 0
print(max)

Solution (Python):
n = input()
l =[]
counter = 0
for str in n:
    if str == 'A' or str == 'T' or str == 'C' or str == 'G':
        counter += 1
    else:
        l.append(counter)
        counter = 0
l.append(counter)
print(max(l))

Solution (Python):
s=input()
n=len(s)
list=["A","C","G","T"]
new=[]
a=0
for i in range(n):
  if s[i] in list:
    a+=1
    if i == n-1:
      new.append(a)
  if s[i] not in list:
    new.append(a)
    a=0
print(max(new))

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

    len_max = 0
    len_cur = 0
    for t in s:
        if t in {'A', 'C', 'G', 'T'}:
            len_cur += 1
        else:
            len_max = max(len_max, len_cur)
            len_cur = 0

    len_max = max(len_max, len_cur)
    print(len_max)


main()

Solution (Python):


S = input()

acgt = {'A', 'C', 'G', 'T'}
longest = 0
length = 0
for c in S:
    if c in acgt:
        length += 1
        longest = max(length, longest)
    else:
        length = 0

print(longest)

Solution (Python):
import re;
print(max(map(len,re.split('[^ACGT]',input()))))

Solution (Python):
s = input()

cnt_max = 0

for i in range(len(s)):
    cnt = 0
    for j in range(i, len(s)):
        if s[j]!="A" and s[j]!="T" and s[j]!="C" and s[j]!="G":
            break
        cnt += 1
    if cnt_max < cnt:
        cnt_max = cnt

print(cnt_max)

Solution (Python):
s=input()
n=len(s)
at=["A","T","G","C"]
ans=[-1]
for i in range(n-1):
    if s[i] not in at:
        ans.append(i)
if s[n-1] in at:
    ans.append(n)
else:
    ans.append(n-1)

m=len(ans)
ans2=[]
for j in range(m-1):
    ans2.append(ans[j+1]-ans[j]-1)




if len(ans)==1:
    print(n)
elif len(ans2)==0:
    print(0)
else:
    print(max(ans2))

Solution (Python):
s = input()
n = len(s)

ans = 0
cnt = 0
for i in range(n):
    if s[i] == "T" or s[i] == "A" or s[i] == "C" or s[i] == "G":
        cnt += 1
        if cnt > ans:
            ans = cnt
    else:
        cnt = 0
print(ans)

Solution (Python):

s = input()
ans = tmp = 0
for i in s:
  if "ACGT".count(i) == 1:
    tmp += 1
    if tmp > ans:
      ans = tmp
  else:
    tmp = 0
print(ans)

Solution (Python):
count = 0
MAX = 0
S = list(input())
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
    count += 1
    if MAX < count:
        MAX = count
  else:
    count = 0

print(MAX)

Solution (Python):
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    S = input()
    str = 'ACGT'
    tmp = 0
    maxv = 0
    for i in range(len(S)):
        if S[i] in str:
            tmp += 1
        else:
            tmp = 0
        maxv = max(maxv, tmp)
    print(maxv)

if __name__ == '__main__':
    main()

Solution (Python):
S = input()
gene = "ACGT"
right = 0
c = 0

for i in range(len(S)):
  right = max(right, i)
  while right < len(S) and S[right] in gene:
    right += 1
  c = max(c, right-i)
print(c)

Solution (Python):
a = input()
b = ["A", "C", "G", "T"]
c = 0
d = 0
for i in range(len(a)):
    e = False
    for j in range(len(b)):
        if a[i] == b[j]:
            e = True
            break
    if e:
        c += 1
        if c > d:
            d = c
    else:
        c = 0
print(d)

Solution (Python):
def main():
    s = list(input())
    cnt = 0
    max_cnt = 0
    for i in s:
        if i == "A" or i == "T" or i == "C" or i == "G":
            cnt += 1
            max_cnt = max(max_cnt,cnt)
        else:
            cnt = 0
    print(max_cnt)



if __name__ == "__main__":
    main()

Solution (Python):
s = input()
n = len(s)

ans = 0
len = 0
for i in s:
    if i in "ACGT":
        len += 1
        ans = max(ans, len)
    else:
        len = 0
        
print(ans)

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

Solution (Python):
def B(n):
    r = ""
    c = 0
    for _ in range(len(n)):
        s = ""
        for i in n[c:]:
            c+=1  
            if i in ["A","T","G","C"]:
                s+=i
            else:
                break
        
        if len(s) > len(r):
            r = s 
    return r

b = input()
print(len(B(b)))

Solution (Python):
S = input()
acgt = 'ACGT'

ans = 0
cnt = 0
for c in S:
    if acgt.find(c) >= 0:
        cnt += 1
    else:
        cnt = 0

    if cnt > ans:
        ans = cnt

print(ans)

Solution (Python):
def judge(target):
	ACGT = ['A','C','G','T']
	for A in ACGT:
		if str(target) == A:
			return True
	return False

Inp = list(input())
max_count = 0

for j in range(len(Inp)):
	count = 0
	match = 1
	for i in range(j,len(Inp)):
		if judge(Inp[i]):
			count += 1
			if count >= max_count :
				max_count = count
		else:
			match = 0
			break
	if match == 0:
		continue


print(max_count)

Solution (Python):
s = list(input())
c = int(0)
result = int(0)
result2 = int(0)

for i in s:
        if(i=="A" or i=="C" or i=="G" or i=="T"):
                c+=1
                result2 = c
        else:
                if(c>result):
                        result = c
                c=0
if(result > result2):
        print(result)
else:
        print(result2)

Solution (Python):
s = input()

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

tmp = 0
ans = 0

for i in range(len(s)):
    if ls.__contains__(s[i]):
        tmp += 1
    else:
        tmp = 0
    if ans < tmp :
        ans = tmp


print(ans)

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

Solution (Python):
s = input()
l = ['A', 'T', 'C', 'G']
ans = 0
temp = 0
for i in range(len(s)):
    if s[i] in l:
        temp += 1
        ans = max(ans, temp)
    else:
        temp = 0
print(ans)

Solution (Python):
S = input()
cnt = 0
max = 0
for i in range(len(S)):
    if S[i] in {"A","C","G","T"}:
        cnt += 1
    else:
        if max < cnt:
            max = cnt
        cnt = 0
if cnt > max:
    max = cnt
print(max)

Solution (Python):
S = input()

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

num_list = [-1]
for i in range(len(S)):
  if S[i] not in ACGT:
    num_list.append(i)

num_list.append(len(S))

dif_list = []
for i in range(len(num_list)-1):
  dif_list.append(num_list[i+1]-num_list[i])
  
print(max(dif_list)-1)

Solution (Python):
s = input()
s += 'Z'
words = ['A','T','G','C']
m = 0
cnt = 0
for i in range(len(s)):
    if s[i] in words:
        cnt += 1
    elif cnt>m:
        m=cnt
        cnt=0
    else:
        cnt=0
print(m)

Solution (Python):
s = input()
s += 'Z'
words = ['A','T','G','C']
m = 0
cnt = 0
for i in range(len(s)):
    if s[i] in words:
        cnt += 1
    elif cnt>m:
        m=cnt
        cnt=0
    else:
        cnt=0
print(m)

Solution (Python):
s = str(input())
ans = 0
for i in range(len(s)):
    for j in range(i,len(s)):
        if all('ATGC'.count(c)==1 for c in s[i:j+1]):
            ans = max(ans, j-i+1)
print(ans)

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

max_count = 0

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

print(max_count)

Solution (Python):
a = input()
maxima=0
c=0
for i in range(0,len(a)):
	if(a[i:i+1]=="A" or a[i:i+1]=="T" or a[i:i+1]=="G" or a[i:i+1]=="C"):
		c=c+1
	else:
		if(c>maxima):
			maxima=c
			c=0
		else:
			c=0
if(c>maxima):
	maxima=c
print(maxima)

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

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

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

Solution (Python):

s = input()
count = 0
max_c = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "T" or s[i] == "C" or s[i] == "G":
        count = count + 1
        if count > max_c:
            max_c = count
        else:
            pass
    else:
        count = 0

print(max_c)

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

Solution (Python):

s = input()
ls = len(s)
part_s = set( [s[i:j+1] for i in range(ls) for j in range(ls)  ])
part_s = [ i for i in part_s if set(list(i)) | set(["A","T","C","G"]) == set(["A","T","C","G"])]
if part_s == []:
    print(0)
else:
    print(max(map(len,part_s)))

Solution (Python):
s=input()

h = 0
tmp = 0

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

Solution (Python):
"""
n = int(sys.stdin.readline())
a, b = map(int, sys.stdin.readline().split())
c = list(map(int, sys.stdin.readline().split()))
s = [list(map(int,list(sys.stdin.readline()))) for i in range(h)]  

a = 100
b = 0.987654321
print('{0:06d}-{1:6f}'.format(a,b))  
000100-0.987654


char_list = list("abcd") 
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)


mod = 1000000007

if __name__ == "__main__":
    target = list("ACGT")
    s = sys.stdin.readline()
    l = 0
    ml = 0
    for w in s:
        if w in target:
            l += 1
        else:
            if ml < l:
                ml = l
            l = 0
    print(ml)

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


AGTC = ['A', 'G', 'T', 'C']
part_l = []
for i in range(N):

        if S[i] in AGTC:
                if i == 0:
                        part = [S[i]]
                elif S[i-1] in AGTC:
                        part.append(S[i])
                else:
                        part = [S[i]]
        else:
                if i == 0:
                        part = []
                elif S[i-1] in AGTC:
                        part_l.append(part)
                        part = []
part_l.append(part)

max_part = []          
for part in part_l:
        if len(part) > len(max_part):
                max_part = part

print(len(max_part))

Solution (Python):
S = input()

len = 0
ans = 0

for i in S:
    if i in "ACGT":
        len += 1
        ans = max(ans, len)
    else:
        len = 0

print(ans)

Solution (Python):
s=input()
x=['A','T','C','G']
a=[0]*len(s)
if s[0] in x:
  a[0]=1
for i in range(1,len(s)):
  if s[i] in x:
    a[i]=a[i-1]+1
print(max(a))

Solution (Python):
s = input()
num = []
lists = ["A","C","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
        count = 0
else:
    num.append(count)
print(max(num))

Solution (Python):
s = input()
z = ''
ans = 0
for i in range(len(s)):
    if s[i] in 'ACGT':
        ans = max(ans, 1)
        for j in range(i+1, len(s)):
            if s[j] in 'ACGT':
                ans = max(ans, j-i+1)
            else:
                break
    else:
        continue
print(ans)

Solution (Python):
from sys import stdin

S = stdin.readline().rstrip()

count = 0
count_list = []
N = len(S)
for i in range(0,N):
    while S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C':
        count += 1
        if i == N - 1:
            break
        i += 1
    count_list.append(count)
    count = 0

count_list.sort()
print(count_list[-1])

Solution (Python):
s = input()
f = False
c = 0
cand = [0]
for item in s + "*":
    if not f and item in ["A", "T", "G", "C"]:
        f = True
        c = 1
        continue
    if f:
        if item in ["A", "T", "G", "C"]:
            c += 1
        else:
            cand.append(c)
            c = 0
            f = False
print(max(cand))

Solution (Python):
S = list(str(input()))
counter = [0]

for i in range(len(S)):
	if S[i] in "ATGC":
		counter[-1] += 1
	else:
		counter.append(0)
print(max(counter))

Solution (Python):
result = 0
cnt = 0
b = list(input())
for str in b:
    if str == "A" or str == "T" or str == "C" or str == "G":
        cnt += 1
        result = max(result,cnt)
    else:
        cnt = 0
print(result)

Solution (Python):
s=input()

char_list=['A','C','G','T']
cnt=0
max=0

for i in range(len(s)):
    if s[i] in char_list:
        cnt+=1
        if cnt>max:
            max=cnt
    else:
        cnt=0
        
print(max)

Solution (Python):
s=str(input())
ans=0
count=0
for i in range(len(s)):
  if s[i] in 'ACGT':
    count+=1
  else :
    count=0
  ans=max(ans,count)
print(ans)

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

ans=0
anss=[]
for i in X:
  if i in ['A','C','G','T']:
    ans+=1

  else:
    ans = 0
  anss.append(ans)

if anss:
  print(max(anss))
else:    
  print(0)

Solution (Python):


s = input()

a = "ACGT"
v = 0
ans = 0

for i in s:
    if i in a:
        v += 1
        ans = max(ans, v)
    else:
        v = 0

print(ans)

Solution (Python):
a = input()+"a"
num=0
b=[]
for i in a:
  if i in 'ATGC':
    num+=1
  else:
    b.append(num)
    num=0
print(max(b))

Solution (Python):
S = input()
N = len(S)
ret = 0

for i in range(N):
    for j in range(i + 1, N+1):
        f = True
        for s in S[i:j]:
            if s not in 'ACGT':
                f = False
                break

        if f:
            ret = max(ret, j - i)

print(ret)

Solution (Python):
s = input()
a = 0
b = 0
for i in s:
    if i in 'ATGC':
        a += 1
    else:
        b = max(a, b)
        a = 0
print(max(a, b))

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

Solution (Python):
S = str(input())
max = 0
for i in range(len(S)):
    k = 0
    if not(S[i] in {'A','T','G','C'}):
        continue
    k = 1
    for j in range(i+1,len(S)):
       if S[j] in {'A','T','G','C'}:
           k+=1
       else:
           break

    if k > max:
        max = k

print(max)

Solution (Python):
import re


s = input()

match = re.findall('[ACGT]*', s)


ans = 0

for m in match:
    ans = max(ans, len(m))

print(ans)

Solution (Python):
s=input()
ans=0
crr=0
words=['A','C','T','G']
for ss in s:
    if ss in words:
        crr+=1
    else:
        crr=0
    ans=max(crr,ans)

print(ans)

Solution (Python):
ch = set(['A','T','C','G'])
s = input()
m = [0]*len(s)
for i in range(len(s)):
    if s[i] in ch:
        m[i] = 1 if i ==0 else m[i-1]+1
print(max(m))

Solution (Python):
def abc():
    import re
    s = input().rstrip()
    g = re.findall(r'[ATCG]*', s)
    print(max([len(x) for x in g]))


abc()

Solution (Python):
S = input()


list = []
for i in range(len(S)):
    if(S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T"):
        list.append(i)

NUM = []
for j in range(len(list)):
    num = 1
    for k in range(j,len(list)-1):
        
        
        
        if(list[k+1] - list[k] == 1):
        
            num += 1
            
        else:
            NUM.append(num)
            
            break
    else:
        NUM.append(num)
        


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

Solution (Python):
s = input()
l = len(s)
a = [0]*l
for i in range(l):
    if s[i] == "A" or s[i] =="T" or s[i] =="C" or s[i] =="G":
        a[i] = 1
m = 0
if a[0] == 1:
  m = 1
for i in range(1,l):
    a[i] = (a[i-1]+1)*a[i]
    if m < a[i]:
        m = a[i]

print(m)

Solution (Python):



import sys

input = sys.stdin.readline

def main():
    S = list(input().strip())
    n = 0
    max_n = 0
    for c in S:
        if c == 'A' or c == 'C' or c == 'G' or c == 'T':
            n += 1
        else:
            n = 0
        max_n = max(max_n, n)
    print(max_n)

main()

Solution (Python):
S = input()
count = [0 for _ in range(len(S))]
for i, s_i in enumerate(S):
  if s_i in ['A', 'G', 'C', 'T']:
    if i == 0:
      count[i] = 1
    else:
      count[i] = count[i-1] + 1
  else:
    count[i] = 0
    
print(max(count))

Solution (Python):
S = input()
L = len(S)
answer = 0
for left in range(L):
  for right in range(left,L):
    T = S[left:right+1]
    if set(T) <= set('ACGT'):
      answer = max(answer,right-left+1)

print(answer)

Solution (Python):
s1 = input()

r1 = 0
n1 = 0
for i1 in range(len(s1)):
    if s1[i1] == "A" or s1[i1] == "T" or s1[i1] == "C" or s1[i1] == "G":
        n1 += 1
    else:
        r1 = max(n1,r1)
        n1 = 0
r1 = max(n1,r1)

print(r1)

Solution (Python):
import math
S = input()
l = len(S)
cs = ["A","G","C","T"]
ma = 0
for i in range (l):
    for j in range(i,l+1):
        sub = S[i:j]

        for c in sub:
            if c not in cs:
                break
        else:
            if len(sub) > ma:
                ma = len(sub)
print(ma)

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

Solution (Python):
s = input()

length, ans = 0, 0
for cha in s:
  if cha in 'ACGT':
    length += 1
    ans = max(ans, length)
  else:
    length = 0
    
print(ans)

Solution (Python):
s_li = list(input())
n = len(s_li)
ans = []
if "A" in s_li or "C" in s_li or "G" in s_li or "T" in s_li:
    co = 0
    for s in s_li:
        if s in ["A","C","G","T"]:
            co += 1
        else:
            ans.append(co)
            co = 0
    ans.append(co)
else:
    ans.append(0)
print(max(ans))

Solution (Python):
s = input()
cnt = 0
cnt_list = [0]*len(s)
for idx,i in enumerate(s):
    if i in 'ACTG ':
        cnt +=1
    else:
        cnt = 0
    cnt_list[idx] = cnt
print(max(cnt_list))

Solution (Python):
s = input()
lis=[]
for i in range(len(s)):
    if s[i] not in "ACGT":
        lis.append(i)
len_max = 0
for i in range(len(lis)-1):
    len_max = max(len_max,lis[i+1]-lis[i]-1)

if lis != []:
    print(max(len_max,lis[0],len(s)-lis[-1]-1))
else:
    print(len(s))

Solution (Python):
s = input()
ans = 0
for i in range(len(s)):
    for j in range(i, len(s)):
        if all('ACGT'.count(c) == 1 for c in s[i : j + 1]):
            ans = max(ans, j - i + 1)
print(ans)

Solution (Python):
s=input()
ans=0
count=0
for i in range(len(s)):
    if s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T':
        count+=1
    else:
        if count>ans:
            ans=count
            count=0
else:
    if count>ans:
        ans=count
print(ans)

Solution (Python):
s = input()
a = 0
b = 0
for i in s:
  if i in 'ATCG':
    a += 1
  else:
    b = max(a, b)
    a = 0
print(max(a,b))

Solution (Python):
s = input()
a=b=0
for i in s:
    if i in 'ATCG':
        a += 1
    else :
        b = max(a,b)
        a = 0

print(max(a,b))

Solution (Python):
S = input()
A = B = 0
for x in S:
  if x in 'ATCG':
    A = A + 1
  else:
    B = max(A,B)
    A = 0
print(max(A,B))

Solution (Python):

s = input()
words = ["A","T","C","G"]

counter = 0
countMax = 0
for i in s:
    if i in words:
        counter += 1
    else:
        countMax = max(countMax,counter)
        counter = 0
else:
    countMax = max(countMax,counter)

print(countMax)

Solution (Python):
b=input()
num=0
m=0

for i in b:
    if(i=="A"):
        num+=1
    elif(i=="T"):
        num+=1
    elif(i=="G"):
        num+=1
    elif(i=="C"):
        num+=1
    else:
        num=0

    m=max(m,num)


print(m)

Solution (Python):
N=input()
N=N.replace("A","0")
N=N.replace("T","0")
N=N.replace("G","0")
N=N.replace("C","0")
n=0
while n < 11:
  if "0"*(10-n) in N:
    print(10-n)
    break
  elif n==10:
    print(0)
    break
  else:
    n=n+1

Solution (Python):
s = input()
slt = list(s)

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

cntlt = list()
cnt = 0
for i in range(0, len(slt)):
    if slt[i] in mojiretu:
        cnt += 1
    else:
        cntlt.append(cnt)
        cnt = 0
else:
    cntlt.append(cnt)

print(max(cntlt))

Solution (Python):
S=[int(c in "ACGT") for c in input()]
for i in range(1,len(S)):S[i]=(S[i-1]+S[i])*S[i]
print(max(S))

Solution (Python):
S=input()
l = len(S)
ans = 0
for i in range(l):
    for j in range(i+1,l+1):
        for c in S[i:j]:
            if not (c in "ACGT") : break
        else:
            ans = max(ans,len(S[i:j]))
print(ans)

Solution (Python):
S=input()
Slist=[]
for i in range(len(S)):
    Slist.append(int(S[i]in['A','C','G','T']))
ans=0
counter=1
for i in range(1,len(S)):
    if Slist[i]!=Slist[i-1]:
        if Slist[i-1]==1:
            ans=max(ans,counter)
        counter=1
    else:
        counter+=1
if Slist[-1]==1:
    ans=max(ans,counter)
print(ans)

Solution (Python):
s = list(input())
maxNum = 0
ans = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        maxNum += 1
        if ans < maxNum:
            ans = maxNum
    else:
        maxNum = 0
print(ans)

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

Solution (Python):
acgt = "ACGT"
S = input()
ans = 0
s = 0
for c in S:
    if c in acgt:
        s += 1
        if c == S[-1]:
            ans = max(ans, s)
    else:
        ans = max(ans, s)
        s = 0

print(ans)

Solution (Python):
acgt = "ACGT"
S = input()
ans = 0
s = 0
for c in S:
    if c in acgt:
        s += 1
    else:
        ans = max(ans, s)
        s = 0

print(max(ans, s))

Solution (Python):
t = input()
acgt = ["A", "C", "G", "T"]
 
i = 0
j = 0
for c in t:
  if c in acgt:
    i += 1
  else:
    j = max(i,j)
    i = 0
 
print(max(i,j))

Solution (Python):
s = input()
acgt = ['A','C','G','T']
cnt = 0
ans = 0
for i in range(len(s)):
    if s[i] in acgt:
        cnt+=1
    else:
        ans = max(ans,cnt)
        cnt = 0
ans = max(ans,cnt)
print(ans)

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

Solution (Python):
s = input()

cnt = 0
max_ = 0

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

print(max_)

Solution (Python):
mx = 0
S = input()
tmp = 0
for ch in S:
    if ch in "ATCG":
        tmp += 1
    else:
        mx = max(tmp, mx)
        tmp = 0

mx = max(tmp, mx)
print(mx)

Solution (Python):
import sys
import re

S=input()
if S.isalpha():
    pattern='[A,T,C,G][A,T,C,G][A,T,C,G][A,T,C,G]*'
    match_list=re.findall(pattern, S)
    if match_list:
        size_str=[]
        for item in match_list:
            size_str.append(len(item))
        print(max(size_str))
    else:
        pattern='[A,T,C,G][A,T,C,G][A,T,C,G]'
        match_list=re.findall(pattern, S)
        if match_list:
            print("3")
        else:
            pattern='[A,T,C,G][A,T,C,G]'
            match_list=re.findall(pattern, S)
            if match_list:
                print("2")
            else:
                pattern='[A,T,C,G]'
                match_list=re.findall(pattern, S)
                if match_list:
                    print("1")
                else:
                    print("0")

Solution (Python):
S=input()
ans=0
nucreotides=["A","C","G","T"]
i=0
p=0

while i<=len(S)-1:
    if S[i] not in nucreotides:
        p=0
        i+=1
    else:
        p+=1
        if ans<=p:
            ans=p
        i+=1
        
print(ans)

Solution (Python):
S = input()
str_list = ['A','C','G','T']
cnt = 0
ans = 0

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

Solution (Python):
b = input()
len = len(b)
ACGT = 0
MAX = 0
flag = 0
for i in range(len):
  if b[i]=="A" or b[i]=="C" or b[i]=="G" or b[i]=="T":
    ACGT += 1
  else:
    if ACGT > MAX:
      MAX = ACGT
    ACGT = 0
if ACGT > MAX:
  MAX = ACGT
print(MAX)

Solution (Python):
S = input()
cnt = 0
ans = 0
acgt = ["A", "C", "G", "T"]
for i in range(len(S)):
    if S[i] in acgt:
        cnt += 1
    else:
        ans = max(cnt, ans)
        cnt = 0

print(max(ans, cnt))

Solution (Python):
import re

S=input()

ans=0
for i in range(10):
  for j in range(i,10+1):
    str=S[i:j]
    if re.search(r'^[AGCT]+$' ,str):
      ans=max(ans,len(str))

print(ans)

Solution (Python):
search_char = ('A', 'T', 'G', 'C')
ans = 0
comp = 0
input_str = input()
for c in input_str:
    if c in search_char:
        comp += 1
    else:
        if ans < comp:
            ans = comp
            comp = 0
else:
    if ans < comp:
        ans = comp
print(ans)

Solution (Python):
ACGT=['A','C','G','T']
def chkAcgt(s):
    p=0
    c=s[p]
    while c in ACGT:
        p+=1
        if p>len(s)-1:
          break
        c=s[p]
    return p

def resolve():
    S=list(input())
    mx=0
    while True:
        if S[0] not in ACGT:
            S.pop(0)
        else:
            mx=max(mx,chkAcgt(S))
            del S[:chkAcgt(S)]

        if len(S)==0:
            break
    print(mx)
resolve()

Solution (Python):
targets = ['A', 'C', 'G', 'T']

S = str(input())

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


ans = max(ans, cnt)
print(ans)

Solution (Python):
input_word=input()
input_word+="E"
atcg_list=["A","T","C","G"]
OK_list=[]
tmp=[]
for i,inp in enumerate(input_word):

    if inp in atcg_list:
        tmp.append(inp)
    else:
        OK_list.append(tmp)
        tmp=[]

print(max([len(ok) for ok in OK_list]))

Solution (Python):
S = input()

N = 0
cnt = 0
maxCnt = 0

while len(S) > N:
    if S[N] == "A" or S[N] == "C" or S[N] == "G" or S[N] == "T":
        N += 1
        cnt += 1
        if maxCnt < cnt:
            maxCnt =cnt
        
    else:
        cnt = 0
        N += 1

print(maxCnt)

Solution (Python):
S = input()

l = 0

for i in range(len(S)+1):
    for j in range(i,len(S)+1):
        if(( \
            (S[i:j].count('A')) + \
            (S[i:j].count('C')) + \
            (S[i:j].count('G')) + \
            (S[i:j].count('T')) \
            ) == len(S[i:j])):
            if(len(S[i:j]) > l):
                l = len(S[i:j])

print(l)

Solution (Python):
c = str(input())
max_count = 0
count = 0

for i in c:
	if i == 'A':
		count += 1
	elif i == 'T':
		count += 1
	elif i == 'C':
		count += 1
	elif i == 'G':
		count += 1
	else:
		if count > max_count:
			max_count = count
		count = 0

if count > max_count:
			max_count = count

print(max_count)

Solution (Python):
s = input()
a = ["A","C","G","T"]
b = [0]
count = 0

for i in s:
    if i in a:
        count += 1
    else:
        b.append(count)
        count = 0
b.append(count)
print(max(b))

Solution (Python):
S = input()

c_max = 0
cnt = 0

for i in S:
    if i == "A" or i == "C" or i ==  "G" or i == "T":
        cnt +=1
        c_max = max(c_max, cnt)
    else:
        c_max = max(c_max, cnt)
        cnt = 0

print(c_max)

Solution (Python):
S = input()

ATCG = ['A','T','C','G']
ans = [0, 0]
for s in S:
    if s in ATCG:
        ans[0] += 1
    else:
        if ans[1] < ans[0]:
            ans[1] = ans[0]
        ans[0] = 0

if ans[1] < ans[0]:
    ans[1] = ans[0]
print(ans[1])