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):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    s = tuple(input())
    r = 0
    s_len = len(s)
    for i1 in range(s_len):
        for i2 in range(i1 + 1, s_len + 1):
            if all([c in ('A', 'T', 'C', 'G') for c in s[i1:i2]]):
                r = max(r, i2 - i1)
    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    s = tuple(input())
    r = 0
    s_len = len(s)
    for i1 in range(s_len):
        for i2 in range(1, s_len - i1 + 1):
            if all([c in ('A', 'T', 'C', 'G') for c in s[i1:i1+i2]]):
                r = max(r, i2)
    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
moji = str(input())
ans = 0
cans = 0
correct = ["A","C","G","T"]
for i in range(len(moji)):
    if moji[i] in correct:
        cans += 1
        if cans > ans:
            ans = cans
    else:
        if cans > ans:
            ans = cans
        cans = 0
print(ans)

Solution (Python):
s = input()
count = 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
    else:    
        tmp = 0
    count = max(tmp,count)
print(count)

Solution (Python):
s = input()
count = 0
max = 0
for i in range(0, 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):
S = input()
L = len(S)
ans = 0
for i in range(L):
    c = 0
    for s in S[i:]:
        if s in ['A', 'C', 'G', 'T']:
            c += 1
        else:
            break
    ans = max(ans, c)

print(ans)

Solution (Python):
S = input ()
S = S.replace('A', 'a')
S = S.replace('T', 'a')
S = S.replace('C', 'a')
S = S.replace('G', 'a')
ans = 0
x = 0
for i in range (len(S)):
  if S[i] == 'a':
    x += 1
  else:
    if ans < x:
      ans = x
    x = 0
if ans < x:
  ans = x
print (ans)

Solution (Python):
s = list(input())
cnt, new_cnt = 0, 0
for x in s:
    if x == "A" or x == "C" or x == "G" or x == "T":
        new_cnt += 1
        if cnt < new_cnt:
            cnt = new_cnt
    else:
        new_cnt = 0

print(cnt)

Solution (Python):
S = input()

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

print(ans)

Solution (Python):

import sys


def solve(S: str):
    ans = 0
    c = 0
    for i in S:
        if i in ["A", "C", "G", "T"]:
            c += 1
        else:
            c = 0
        if c > ans:
            ans = c
    print(ans)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

mx = 0
cnt = 0

for (i, char) in enumerate(s):
    if char in "ACGT":
        cnt += 1
    else:
        mx = max(mx, cnt)
        cnt = 0

mx = max(cnt, mx)

print(mx)

Solution (Python):
s = input()

count = 0
ans = 0

for i in s:
    if i in {'A', 'T', 'C', 'G'}:
        count += 1
    else:
        count = 0
    ans = max(ans, count)

print(ans)

Solution (Python):
import itertools
S = input()
ans = 0
for i,j in itertools.combinations(range(len(S)+1), 2):
    if all('ACTG'.count(c)==1 for c in S[i:j]):
        ans = max(ans, len(S[i:j]))
print(ans)

Solution (Python):
import re
S = input()
r = re.findall('[ACTG]+', S)
print(max([len(_) for _ in r], default=0))

Solution (Python):
S = list(input())
temp = 0
ans = 0
letter = ["A", "T", "C", "G"]
for i, val in enumerate(S):
  if val in letter:
    temp += 1
  else:
    if ans < temp:
      ans = temp
    temp = 0
if ans < temp:
  ans = temp
print(ans)

Solution (Python):
def main():
    
    
    
    s = input()
    
    count = 0
    maxi = 0
    for string in s:
        if string == "A" or string == "C" or string == "G" or string == "T":
            count += 1
            maxi= max(count, maxi)
        else:
            count = 0

    print(maxi)


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
score=0
ans=[]
for i in s:
  if i in {"A", "T", "C", "G"}:
    score+=1
  else:
    score=0
  ans.append(score)
print(max(ans))

Solution (Python):
s = input()
score=0
ans=0
for i in s:
  if i in {"A", "T", "C", "G"}:
    score+=1
  else:
    score=0
  ans=max(score,ans)
print(ans)

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

for c in s:
    if c in {'A', 'C', 'G', 'T'}:
        length += 1
    else:
        length = 0

    ans = max(length, ans)

print(ans)

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

count = 0
ans = 0
flg = False

for word in S:
    if word=="A" or word=="C" or word=="G" or word=="T":
        flg = True
    else:
        flg=False
        count = 0
    
    if flg:
        count += 1
    ans = max(ans,count)

print(ans)

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

Solution (Python):
S = input()

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

Solution (Python):

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

Solution (Python):
S = input()

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

Solution (Python):

import re
S = input()
S_sp = re.split("[^ACGT]",S)
ans = 0
for moji in S_sp:
    if len(moji) > ans:
        ans = len(moji) 

print(ans)

Solution (Python):
s = input()

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

Solution (Python):
s=input()

tmp=0
length=[]

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

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

ans = 0
now = 0
for i in s:
    if i in l:
        now += 1
        if now > ans:
            ans = now
    else:
        now = 0

print(ans)

Solution (Python):
s = list(input())
n = len(s)
res = 0
for i in range(n):
    for j in range(i,n):
        temp = s[i:j+1]
        if all(i in 'ATGC' for i in temp):
            res = max(res,len(temp))
print(res)

Solution (Python):
S = input()
S += '*'
st = 'ACGT'
i, n = 0, len(S)
max_len = 0
while i < n:
    j = i
    size = 0
    while S[j] in st:
        size += 1
        j += 1
    i = j+1
    max_len = max(max_len, size)
print(max_len)

Solution (Python):
items = ['A', 'C', 'G', 'T']
 
def max(a, b):
    return a if a > b else b
x= 0
y = 0
for c in list(input()):
    if c in items:
 
        y += 1
        x = max(x, y)
    else:
        y = 0
print(x)

Solution (Python):
s = input()
S = ""
for i in s:
    if i in "ACGT":S+="1"
    else:S+="0"
print(max(list(map(len,S.split("0")))))

Solution (Python):
s = input()
S = ""
for i in s:
    if i in "ACGT":
        S+="1"
    else:
        S+="0"
        
ans = max(list(map(len,S.split("0"))))
print(ans)

Solution (Python):
import re
print(max([0]+[len(r) for r in re.findall("[ACGT]+",input())]))

Solution (Python):
s = input()
cnt = 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':
        cnt += 1
    else:
        cnt = 0
    ans = max(ans,cnt)
print(ans)

Solution (Python):
a =['A','C','G','T']
s = list(input())
cnt = 0
ans = cnt

for i in s:
    if a.count(i):
        cnt += 1
        if ans < cnt:
            ans = cnt
    else:
        cnt = 0

print(ans)

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].replace('A','')
    t = t.replace('C','')
    t = t.replace('G','')
    t = t.replace('T','')
    if t == '':
      ans = max(j-i,ans)
print(ans)

Solution (Python):



S = input()

N = len(S)

ret = 0
for i in range(N):
    for j in range(i, N):
        sub = S[i:j+1]
        if all(c in ('A', 'C', 'G', 'T') for c in sub):
            ret = max(ret, len(sub))

print(ret)

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

for i in range(len(s)):
    if s[i] == 'C'or s[i] == 'G' or s[i] == 'T':
        s[i] = 'A'

s = ''.join(s)
n = s.count('A')

for i in range(n+1)[::-1]:
    if 'A' * i in s:
        print(i)
        break
else:
    print(0)

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

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

Solution (Python):
S = input()
count = 0
max = 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 max < count:
            max = count
        count = 0
if max < count:
    max = count
print(max)

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

result.append(i)
result.sort()
print(result[-1])

Solution (Python):


def II(): return int(input())
def MII(): return map(int, input().split())
def LII(): return list(map(int, input().split()))

def main():
    S = input()
    S += "$"

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

    print(ans)

if __name__ == '__main__':
    main()

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

print(ans)

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

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

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

Solution (Python):
S = input()

ans = 0
l = 0

for c in S:
    l += 1
    if not c in ('A', 'C', 'G', 'T'):
        l = 0
    ans = max(ans, l)

print(ans)

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

Solution (Python):
S = input()
count = 0
koremade = 0
for i in range(0,len(S)):
    if S[i] in 'ACGT':
        count += 1
        if i == len(S)-1:
           if koremade <= count:
               koremade = count 
    else:
        if koremade <= count:
            koremade = count
        count = 0
print(koremade)

Solution (Python):
S = input()
cnt = 0
cntmax = 0
for i in range(len(S)):
    if S[i] == "A" or S[i] == "T" or S[i] == "G" or S[i] == "C":
        cnt+=1
        if cnt>cntmax:
            cntmax = cnt
    else:
        cnt = 0

print(cntmax)

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

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

Solution (Python):
import re
S = input()
print(len(max(re.findall('[ACTG]+', S), key=len, default='')))

Solution (Python):
s=input()

count=0
a_list=[]
b_list=["A", "C", "G", "T"]
num=len(s)

for i in range(num):
    if s[i] in b_list:
        count+=1
    else:
        a_list.append(count)
        count=0
a_list.append(count)

print(max(a_list))

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

s = input()
n = len(s)
t = [0] * (n+1)

for i in range(n):
    if s[i] in items:
        t[i + 1] += t[i] + 1
    else:
        t[i + 1] += 0
print(max(t))

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

def chkmax(a, b):
    return a if a > b else b

res = 0
cnt = 0
for c in list(input()):
    if c in items:
        cnt += 1
        res = chkmax(res, cnt)
    else:
        cnt = 0
print(res)

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

l=[]
cnt=0

for i in s:
  if i=='A' or i=='C' or i=='G' or i=='T':
    cnt+=1
  else:
    if cnt!=0:
      l.append(cnt)
      cnt=0

l.append(cnt)
print(max(l))

Solution (Python):
S = input()
ans = 0
for i in range(len(S)):
  for j in range(i, len(S)):
    if all('ACTG'.count(c) == 1 for c in S[i:j+1]):
      ans = max(ans, j+1-i)
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):
import re
pattern = re.compile('[ACGT]+')
S = input()
print(len(max(re.findall(pattern, S), key=len, default='')))

Solution (Python):
import re
print(max(len(i) for i in re.sub(r'[^ACGT]', '_', input()).split('_')))

Solution (Python):



import sys

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 = str(input())
'''
ans = 0
memo = 0

for i in range(len(s)):
    if s[i] != "A" and s[i] !="C" and s[i] != "G" and s[i] !="T":
        if i-memo > ans:
            ans = i-memo
        memo = i+1
        

print(ans)



'''
ans = 0
memo = 0

for i in range(len(s)):
    if s[i] == "A" or s[i] =="C" or s[i] == "G" or s[i] =="T":
        memo += 1
    else:
        if ans < memo:
            ans = memo
            memo = 0
if ans < memo:
    ans = memo


print(ans)

Solution (Python):
S = input()
T = S.replace('A','1').replace('C','1').replace('G','1').replace('T','1')
a = 0
for s in range(10):
  if '1'*(10-s) in T:
    a=1
    print(10-s)
    break
if a == 0:
  print('0')

Solution (Python):
S = str(input())
M = []
con = 0
for j in S:
  if j == 'A' or j == 'C' or j == 'G' or j == 'T':
    con += 1
  else:
    if con != 0:
      M.append(con)
    con = 0
M.append(con)
print(max(M))

Solution (Python):
s = input()
acgt = 'ACGT'
max_count = 0
i = 0
while i < len(s):
    count = 0
    if s[i] not in acgt:
        i += 1
        continue
    count += 1
    for j in range(i+1, len(s)):
        if s[j] not in acgt:
            break
        count += 1
    if count > max_count:
        max_count = count
    i += count + 1
print(max_count)

Solution (Python):
s = str(input())
n = len(s)
ans,ch = 0,0
for i in range(n):
  if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
    ch += 1
  else:
    ch = 0
  if ch >= ans:
    ans = ch
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,len(s[i:j+1]))
print(ans)

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:
    count = 0
  if count > ans:
    ans = count
print(ans)

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

Solution (Python):
a=input()
b=0
c=0
for i in range(len(a)):
  if a[i]=="A" or a[i]=="C" or a[i]=="G" or a[i]=="T":
    b=b+1
    if c<b:
      c=b
  if a[i]!="A" and a[i]!="C" and a[i]!="G" and a[i]!="T":
    b=0
print(c)

Solution (Python):
s =  list(input())
combo = False
cnt = 0
ans = [0,] 
for mozi in s:
    if(mozi == "A" or mozi == "G" or mozi == "C" or mozi == "T"):
        cnt = cnt + 1 
        if combo != True:
            combo = True
    else:
        if combo:
            ans.append(cnt)
            cnt = 0
            combo = False
ans.append(cnt)
print(max(ans))

Solution (Python):
argStr = input()
ret=0
tmp=0
flag = False
for s in argStr:
    
    if (s=='A') | (s == 'C') | (s=='G') | (s=='T'):
        flag = True
        tmp+=1
    else:
        if flag :
            if( ret < tmp):
                ret = tmp
                tmp = 0
            flag = False
if( ret < tmp):
    ret = tmp
print(ret)

Solution (Python):
s = input()
t = ['A','C','G','T']

ans = 0
tmp_ans = 0
for i in s:
    if i in t:
        tmp_ans += 1
    else:
        ans = max(tmp_ans, ans)
        tmp_ans = 0
ans = max(tmp_ans, ans)
print(ans)

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

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

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

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

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

print(max(ans))

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

ans_s = ''
for i in range(len(S)):
    for k in range(len(S[i:])):
        cnt = 0
        for s in S[i:i+k+1]:
            if s in ['A', 'C', 'G', 'T']:
                cnt += 1
        if cnt == len(S[i:i+k+1]) and cnt >= len(ans_s):
            ans_s = S[i:i+k+1]

print(len(ans_s))

Solution (Python):
s = input()
s += 'q'
ans = ''
lst = []
for ss in s:
    if ss in ['A', 'C', 'G', 'T']:
        ans += ss
    else:
        lst.append(len(ans))
        ans = ''
print(max(lst))

Solution (Python):

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

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

tmp = 0
for i in range(sn):
    for j in range(i + 1, sn + 1):
        t = s[i : j]
        tn = len(t)
        
        cnt_t = 0
        for k in range(tn):
            if t[k] == "A" or t[k] == "G" or t[k] == "C" or t[k] == "T":
                cnt_t += 1
                
                if cnt_t == tn and tmp < j - i:
                    tmp = j - i

print(tmp)

Solution (Python):
S = input()

ans = 0
for i in range(len(S)):
    for j in range(i+1, len(S)+1):
        for s in S[i:j]:
            if s != "A" and s != "C" and s != "G" and s != "T":
                break
        else:
            ans = max(ans, len(S[i:j]))
print(ans)

Solution (Python):

def calc_digit_sum(num):
    sums = 0
    while num > 0:
        sums += num % 10
        num //= 10
    return sums


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

answer = cnt = 0
for ch in s:
    if ch not in contains:
        cnt = 0
    else:
        cnt += 1
    answer = max(answer, cnt)

print(answer)

Solution (Python):
S = input()
check = set("AGCT")

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

Solution (Python):
s = str(input())
a = ['A','T','G','C']
b = []
c = 0
for i in s:
    if i in a:
        c += 1
    else:
        b += [c]
        c = 0
b += [c]
if b == []:
    print(len(s))
else:
    print(max(b))

Solution (Python):
s = input()
a = ['A','T','G','C']
ans = []
c = 0

for i in s:
    if i in a:
        c += 1
    else:
        ans += [c]
        c = 0
ans += [c]
if ans == []:
    print(len(s))
else:
    print(max(ans))

Solution (Python):
import sys
import math
import numpy as np
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    def f(s):
        if s == "":return 0
        t = s.replace("A","").replace("T","").replace("G","").replace("C","")
        if t == "":return len(s)
        else:return 0
    s = S()
    n = len(s)
    ans = 0
    cnt = 0
    for i in range(n):
        for j in range(i,n):
            t = s[i:j+1]
            ans = max(f(t),ans)
    print(ans)

Solution (Python):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

ans = 0
cnt = 0
for i in range(len(s)):
	if cnt == 0:
		if s[i] in ["A", "T", "G", "C"]:
			cnt += 1
			if i == len(s)-1:
				ans = max(ans, cnt)
	elif cnt >= 1:
		if s[i] in ["A", "T", "G", "C"]:
			cnt += 1
			if i == len(s)-1:
				ans = max(ans,cnt)
		else:
			ans = max(ans,cnt)
			cnt = 0
print(ans)

Solution (Python):
S=str(input())
S=list(map(str,S))
count=0
real_count=0
for i in range(len(S)):
  if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T':
    for j in range(i,len(S)):
      if S[j]=='A' or S[j]=='C' or S[j]=='G' or S[j]=='T':
        count+=1
      else:
        break
    if count>real_count:
      real_count=count
    count=0
print(real_count)

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

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

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

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

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

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

Solution (Python):
S = input()
L = list("ACGT")

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

print(ans)

Solution (Python):
S=input()
temp=0
ans=0
ACGT=["A","C","G","T"]
for i in range(len(S)):
    if S[i] in ACGT:
        temp+=1
    else:
        if temp>ans:
            ans=temp
        temp=0
if temp>ans:
    ans=temp
print(ans)

Solution (Python):
s = input()

ans = 0
for i in range(len(s)):
    for j in range(i,len(s)):
        tmp = s[i:j+1]
        if set(list(tmp)) <= set(["A","C","G","T"]):
            ans = max(ans,len(tmp))
print(ans)

Solution (Python):
import re
S = input()
string = re.findall(r'([ACGT]+)', S)

if len(string) != 0:
  lenst = [len(x) for x in string]
  print(max(lenst))
  
else:
  print(0)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    N = len(S)

    ans = 0

    for i in range(N):
        for j in range(i, N):
            for k in range(i, j + 1):
                if S[k] not in ("A", "C", "G", "T"):
                    break
            else:
                ans = max(ans, j - i + 1)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
count = 0
lens = []

for i, _ in enumerate(s):
  for c in s[i:]:
    if c in ['A', 'G', 'C', 'T']:
      count += 1
    else:
      break
  lens.append(count)
  count = 0
  
print(max(lens))

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

Solution (Python):
S = input()
s = {"A", "C", "G", "T"}
ans = 0
tmp = 0
for i in S:
  if i in s:
    tmp += 1
    ans = max(ans, tmp)
  else:
    tmp = 0
print(ans)

Solution (Python):
S = list(input())
ACGT = ["A", "C", "G", "T"]
count = 0
Max = 0
if len(S) == 1:
    if  S[0] in ACGT:
        print(1)
    else:
        print(0)
else:
    for s in S:
        if s in ACGT:
            count += 1
            if count > Max:
                Max = count
        else:
            if count > Max:
                Max = count
            count = 0
    print(Max)

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

Solution (Python):
S=str(input())
S2=[]
ans=0
for i in range(len(S)):
  for j in range(len(S)+1):
    S2=S[i:j]
    que=len(S2)
    S2=S2.replace("A","")
    S2=S2.replace("G","")
    S2=S2.replace("C","")
    S2=S2.replace("T","")
    if S2=="":
      if que>ans:
        ans=que
    S2=[] 
print(ans)

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

print(ans)

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

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

start = False
counts = [0]

for i, c in enumerate(S):
	if c in l:
		if start == False:
			start = True
			count = 1
		else:
			count += 1
			
		if i == len(S) - 1:
			counts.append(count)
	else:
		if start == False:
			continue
		else:
			start = False
			counts.append(count)
			count = 0

print(max(counts))

Solution (Python):
a=input()
total=0
total2=0
i=0
while True:
    if i==len(a):
        break
    elif a[i]=="A" or a[i]=="T" or a[i]=="C" or a[i]=="G":
        total+=1
        i+=1
    else:
        i+=1
        if total2<total:
            total2=total
        total=0
if total2<total:
    print(total)
else:
    print(total2)

Solution (Python):
s = input()
length = 0
max_length = 0

for i in range(len(s)):
    if s[i] in 'ACGT':
        length += 1
    else:
        length = 0
    if length > max_length:
        max_length = length
print(max_length)

Solution (Python):
def is_ACGT(c):
    return c == "A" or c == "C" or c == "G" or c == "T"

S = input()

ans = 0
for i in range(len(S)):
    j = 0
    while i+j < len(S) and is_ACGT(S[i+j]):
        j += 1
    ans = max(ans, j)

print(ans)

Solution (Python):

S=input()

l = len(S)
ans=0
for i in range(l):
    for j in range(i,l):
        ss = S[i:j+1]
        if all(sss in ["A","G","C","T"] for sss in ss):
            cand = len(ss)
            ans=max(ans,cand)
print(ans)

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

ans = 0
tmp = 0
ACGT = {"A", "C", "G", "T"}
i = 0
while i < N:
  if S[i] in ACGT:
    tmp += 1
  else:
    ans = max(ans, tmp)
    tmp = 0
  i += 1
    
ans = max(ans, tmp)  

print(ans)

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

Solution (Python):
S = input()

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

ans = 0
tmp = 0
for v in s:
    if v in ('A', 'C', 'G', 'T'):
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

ans = max(ans, tmp)

print(ans)

Solution (Python):
def main():
    s = input()
    acgt_flag = [0 for i in range(len(s))]

    for i in range(len(s)):
        if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
            acgt_flag[i] = 1

    counter = 0
    counter_max = 0
    for i in range(len(acgt_flag)):
        if acgt_flag[i] == 1:
            counter += 1
            if counter_max < counter:
                counter_max = counter
        else:
            counter = 0

    print(counter_max)


if __name__ == '__main__':
    main()

Solution (Python):
n = input()
count=0
m = 0
for s in n:
  if s =="A" or s == "C" or s == "G" or s== "T" :
    count+=1
    m =max(m,count)
  else:
    count=0
print(m)

Solution (Python):
s = str(input().split())
S = list(s)

ans = 0
alist = []

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

Solution (Python):
S = input()
S += '0'
max = 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 > max :
            max = count
            count = 0

print(max)