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

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
mo = 10**9+7

def main():
	s = IS()
	ans = 0
	cnt = 0
	for ss in s:
		if ss=="A" or ss=="T" or ss=="G" or ss=="C":
			cnt += 1
		else:
			ans = max(ans,cnt)
			cnt=0
	ans = max(ans,cnt)
	print(ans)

if __name__ == '__main__':
	main()

Solution (Python):
b = input()
n = len(b)
ans = 0
kar = 0
for i in range(n):
    for j in range(i,n):
        if b[j] == "A" or b[j] == "T" or b[j] == "G" or b[j] == "C":
           kar += 1
        else:
            if kar > ans:
                ans = kar
            kar = 0
        if j == n - 1:
            if kar > ans:
                ans = kar
            kar = 0
print(ans)

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

cnt = 0
ans = 0
check = ["A", "C", "G", "T"]

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

Solution (Python):
S = input()
ls = len(S)
c = [0]*ls

for i in range(ls):
  if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
    for j in range(i,ls):
      if S[j] == "A" or S[j] == "C" or S[j] == "G" or S[j] == "T":
        c[i] += 1
      else:
        break
      
print(max(c))

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

Solution (Python):
s = input()
j = 0
a = [0]
for i in s:
    if (i == 'A') or (i == 'C') or (i == 'G') or (i == 'T'):
        a[j] += 1
    else:
        a.append(0)
        j += 1
a = sorted(a,reverse = True)
print(a[0])

Solution (Python):
s = input()
count = 0
temp = 0
for i in range(len(s)):
  if s[i] in "ACGT":
    temp += 1
  elif temp:
    if count < temp:
      count = temp
    temp = 0
if count < temp:
  count = temp
print(count)

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

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

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

Solution (Python):
s = list(input())
key = ['A','T','G','C']
count = 0
flag = False
ans = 0
for i in range(len(s)):
  if s[i] in key:
    count += 1
    flag = True
  if flag==True and (s[i] not in key):
    ans = max(ans,count)
    count = 0
    flag = False
ans = max(ans,count)
print(ans)

Solution (Python):

import sys
input = sys.stdin.readline









S = input().rstrip()

S += "Z"
ans = 0

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

print(ans)

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

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

print(res)

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

else:
  print(ans)

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

else:
  print(max(count,ans))

Solution (Python):
import numpy as np
s = input()
ans = 0
reg = 0
for i in range(len(s)):
    if(s[i] == 'A' or s[i] == 'G' or s[i] == 'C' or s[i] == 'T'):
        reg += 1
    else:
        reg = 0
        continue
    if(ans<reg):
        ans = reg
print(ans)

Solution (Python):
S = input()
atgc = ["A", "T", "G", "C"]
anset = set()
L = 0
for i in range(len(S)):
    if S[i] in atgc:
        L += 1
    else:
        anset.add(L)
        L = 0
    if i == len(S)-1:
        anset.add(L)

print(max(anset))

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

print(max(count))

Solution (Python):
def myAnswer(S:str) -> int:
   ans = 0
   a=[chr(i) for i in range(65, 65+26)]
   a.remove("A")
   a.remove("T")
   a.remove("C")
   a.remove("G")
   counter = 0
   for s in S:
      if((s in a) == False):
         counter +=1
      else:
         ans=max(counter,ans)
         counter=0
   return max(ans,counter)


def modelAnswer():
   tmp=1
def main():
   S = input()
   print(myAnswer(S))

if __name__ == '__main__':
   main()

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


flag = False
best = 0
a = 0

for s in S:
    if s in acgt:
        if flag:
            a += 1
        else:
            a = 1
            flag = True
        if a > best:
            best = a
    else:
        if flag:
            flag = False
print(best)

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

N = len(string_data)
match_word_lits = ['A', 'C', 'G', 'T']
count = 0
max_word = 0
for i in range(N):
    if string_data[i] in match_word_lits:
        count += 1
        if max_word < count:
            max_word = count
    else:
        count = 0

print(max_word)

Solution (Python):
import sys
input = sys.stdin.readline 

s = input().replace("\n","")

ans = 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
            if cnt > ans:
                ans = cnt
        else:
            
            break

print(ans)

Solution (Python):
s = input()
acgt = ["A", "C", "G", "T"]

ans = 0
cnt = 0
suffix = 0

while suffix < len(s):
    if s[suffix] in acgt:
        cnt += 1
    else:
        cnt = 0
    ans = max(ans, cnt)
    suffix += 1
print(ans)

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

Solution (Python):
S = input()

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

Solution (Python):
S = input()
c = 0
MAX = 0
 
for i in S:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        c += 1
        if MAX < c:
            MAX = c
 
    else:
        c = 0
 
print(MAX)

Solution (Python):
S = input()

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

Solution (Python):
M=L=0
for i in input():
    if i in'ATCG':L+=1;M=max(M,L)
    else:L=0
print(M)

Solution (Python):


def main():
    s = input()
    n = len(s)
    
    ans = 0
    cnt = 0 
    for i in range(n):
        if not ((s[i] == 'A') or (s[i] == 'T') or (s[i] == 'C') or (s[i] == 'G')):
            cnt = 0
        else:
            cnt += 1
        ans = max(cnt, ans)
    print(ans)
main()

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

Solution (Python):
s = input()

tmp = 0
big = 0

for i in s:
    if i not in ['A', 'C', 'G', 'T']:
        tmp = 0
    else:
        tmp += 1
        big = max(tmp, big)

print(big)

Solution (Python):
ans=0;now=0
for i in list(input()):
    if i in {"A","G","C","T"}:now+=1
    elif now:ans=max(now,ans);now=0
print(max(now,ans))

Solution (Python):
S = str(input())
ans = []
for i in range(len(S)):
    preans = []
    if S[i] == "A" or S[i] == "C" or S[i]  == "G" or S[i] =="T":
        preans.append(S[i])
        for j in range(1,len(S)-i):
            if S[i+j] == "A" or S[i+j] == "C" or S[i+j]  == "G" or S[i+j] =="T":
                preans.append(S[i+j])
            else:
                break
    if len(preans) > len(ans):
        ans = preans
if len(ans) == 2 and ans[0] == "A" and ans[1] == "C":
    print(0)
else:
    print(len(ans))

Solution (Python):
M=L=0
for i in input():
    if i in'ATCG':L+=1;M=max(M,L)
    else:L=0
print(M)

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

Solution (Python):
s = str(input())
s += "B"
l = len(s)
c = 0
mx = 0
for i in range(l):
  if s[i] in ["A","G","C","T"]:
    c += 1
  else:
    if c > mx:
      mx = c
      c = 0
    else:
      c = 0
print(mx)

Solution (Python):
s = input()
ary1 = "".join([x if x in ["A","C","G","T"] else " " for x in s]).split()
if ary1 ==[]:
  print(0)
else:  
  print(max([len(x) for x in ary1]))

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

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

Solution (Python):
s=input()
n=len(s)
def check(s):
    a=list(set(list(s)))
    b=list("ACGT")
    for i in b:
        if i in a:
            a.remove(i)
    if a==[]:
        return len(s)
    return 0
ans=0
for i in range(n):
    for j in range(n+1):
        ans=max(ans,check(s[i:j]))
print(ans)

Solution (Python):
S = input()
ans = 0
for i in range(len(S)):
    for j in range(i,len(S)):
        s = S[i:j+1]
        if sum([s.count(x) for x in 'ACGT']) == len(s):
            ans = max(ans, len(s))

print(ans)

Solution (Python):
def hantei(n):
    for i in range(len(n)):
        if n[i]!="A" and n[i]!="G" and n[i]!="T" and n[i]!="C":
            return False

s=input()
T=[]
n=[]
m=[]
x=0

for i in range(len(s)-1):
    for j in range(i+1,len(s)):
        T.append(s[i:j+1])

for i in range(len(s)):
    T.append(s[i])

flag=False
for i in range(len(T)):
    w=T[i]
    if hantei(w)!=False:
        n.append(w)


for i in range(len(n)):
    m.append(len(n[i]))

if not m:
    print(0)
else:
    print(max(m))

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

Solution (Python):
s = input()

n = len(s)
ans = 0
for i in range(n):
    x = s[i]
    count = 0
    if x == 'A' or x == 'C' or x == 'G' or x == 'T':
        count += 1
        for j in range(i+1,n):
            x = s[j]
            if x == 'A' or x == 'C' or x == 'G' or x == 'T':
                count += 1
            else:
                break
    ans = max(count,ans)
print(ans)

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

cnt=0
ans=0
for x in S:
    if x=="A" or x=="C" or x=="G" or x=="T":
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt

        cnt=0

    if ans < cnt:
        ans = cnt

print(ans)

Solution (Python):
s = input()
l = len(s)
import collections
s = collections.deque(s)
ans = collections.deque()
chk = 0
for i in range(l):
  c = s.popleft()
  if c == 'A' or c == 'T' or c == 'C' or c == 'G':
    chk += 1
  else:
    ans.append(chk)
    chk = 0
ans.append(chk)
print(max(ans))

Solution (Python):
mod = 10 ** 9 + 7
mod2 = 2 ** 61 + 1
from collections import deque
import heapq
import time
from bisect import bisect_left, insort_left, bisect_right
import sys
import random
import itertools

input = sys.stdin.readline
_NUMINT_ALL = list(range(10))
_START_TIME = time.time()


def main():
    ans = solve()

    if ans is True or ans is False:
        YesNo(ans)
    elif ans is not None:
        print(ans)


def solve():

    s = input()

    ans = 0
    n = 0
    for i in s:
        if i in ("A", "C", "G", "T"):
            n += 1
        else:
            n = 0
        ans = max(n, ans)

    print(ans)







def kiriage_warizan(a, b):
    return -(-a//b)


def iip(listed=True):  
    d = input().rstrip("\n").split()
    try:
        ret = [int(i) for i in d]
    except:
        ret = [int(i) if i in _NUMINT_ALL else i for i in d]
        if len(ret) == 1 and listed is False:
            return ret[0]

    if len(ret) == 1 and not listed:
        return ret[0]
    return ret

def iipt(l, listed=True, num_only=True):  
    ret = []
    for i in range(l):
        ret.append(iip(listed=listed))
    return ret


def saidai_kouyakusuu(A):  
    l = len(A)
    while True:
        m = min(A)
        mx = max(A)
        if m == mx:
            return m

        for i in range(l):
            if A[i] % m == 0:
                A[i] = m
            else:
                A[i] %= m

def time_debug_10percent():
    a = random.randint(0, 9)
    if a == 9:
        sys.exit()

def time_debug(t):
    time.sleep(_START_TIME + t - time.time())
    sys.exit()


def make_graph_edge_flat(N):  
    ret = []
    for i in range(N-1):
        a, b, c = iip()
        a -= 1
        b -= 1
        ret[a].append((b, c))
        ret[b].append((a, c))
    return ret


def sort_tuples(l, index):  
    if isinstance(l, list):
        l.sort(key=lambda x: x[index])
        return l
    else:
        l = list(l)
        return sorted(l, key=lambda x: x[index])


def count_elements(l):  
    d = {}
    for i in l:
        if i in d:
            d[i] += 1
        else:
            d[i] = 1
    return d


def safeget(l, index, default="exception"):  
    if index >= len(l):                      
        if default == "exception":
            raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。配列の長さは", len(l), "です"]))
        else:
            return default
    elif index < 0:
        if default == "exception":
            raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。負の値は許可されていません"]))
        else:
            return default
    else:
        return l[index]


def sortstr(s):  
    return "".join(sorted(s))


def iip_ord(startcode="a"):  
    if isinstance(startcode, str):
        startcode = ord(startcode)
    return [ord(i) - startcode for i in input()]


def YesNo(s):  
    if s:
        print("Yes")
    else:
        print("No")


def fprint(s):  
    for i in s:
        print(i)


def bitall(N):  
    ret = []
    for i in range(2 ** N):
        a = []
        for j in range(N):
            a.append(i % 2)
            i //= 2
        ret.append(a)
    return ret

def split_print_space(s):  
    print(" ".join([str(i) for i in s]))


def split_print_enter(s):  
    print("\n".join([str(i) for i in s]))


def soinsuu_bunkai(n):  
    ret = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret


def conbination(n, r, mod, test=False):  
    if n <= 0:
        return 0
    if r == 0:
        return 1
    if r < 0:
        return 0
    if r == 1:
        return n
    ret = 1
    for i in range(n - r + 1, n + 1):
        ret *= i
        ret = ret % mod

    bunbo = 1
    for i in range(1, r + 1):
        bunbo *= i
        bunbo = bunbo % mod

    ret = (ret * inv(bunbo, mod)) % mod
    if test:
        
        pass
    return ret


def inv(n, mod):  
    return power(n, mod - 2)


def power(n, p, mod_=mod):  
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p // 2, mod_) ** 2) % mod_
    if p % 2 == 1:
        return (n * power(n, p - 1, mod_)) % mod_


def nibutan_func(func, target, left, right, side="left"): 
    l = left
    r = right
    x = (l + r) // 2
    while r-l > 1:
        x = (l+r)//2
        if func(x) == target:
            return x
        elif func(x) > target:
            r = x
        else:
            l = x

    if side == "left" or func(x) == target:
        return l
    else:
        return r


def nibutan_list(list_, target, side="left"):  
    if not isinstance(list_, list):
        list_ = list(list_)

    l = 0
    r = len(list_)
    x = (l + r) // 2
    while r-l > 1:
        x = (l+r)//2
        if list_[x] == target:
            return x
        elif list_[x] > target:
            r = x
        else:
            l = x

    if side == "left" or list_[x] == target:
        return l
    else:
        return r


class UfTree():
    def __init__(self, maxnum):
        self.parent = list(range(maxnum))
        self._size = [1] * maxnum
        self.rank = [0] * maxnum

    def size(self, a):
        return self._size[self.root(a)]

    def root(self, a):
        rank = 0
        cur = a
        while True:
            if self.parent[cur] == cur:
                
                
                return cur
            else:
                self.parent[cur] = self.parent[self.parent[cur]]
                cur = self.parent[cur]
                rank += 1

    def unite(self, a, b):
        ra = self.root(a)
        rb = self.root(b)
        if ra == rb:
            return self

        self._size[ra] += self._size[rb]
        self.parent[rb] = ra
        return self

if __name__ == "__main__":
    main()

Solution (Python):
S=input()
res=0
for i in range(len(S)+1):
    for j in range(i):
        t=True
        s=S[j:i]
        for k in range(len(s)):
            if(s[k]!='A' and s[k]!='C' and s[k]!='G' and s[k]!='T'):
                t=0
                break
        if(t):
            res=max(res,len(s))
print(res)

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

Solution (Python):
S = input()
n = len(S)
maxs = ""

for left in range(n):
    right = left
    while (right < n and S[right] in {'A', 'T', 'G', 'C'}):
        maxs = max(maxs, S[left:right+1], key=len)
        right += 1

print(len(maxs))

Solution (Python):
import numpy as np
import sys
readline = sys.stdin.readline
read = sys.stdin.read

b = readline().rstrip()
ans = 0
i = 0
while i < len(b):
	cnt = 0
	while i < len(b) and (b[i] == 'A' or b[i] == 'T' or b[i] == 'G' or b[i] == 'C'):
		cnt += 1
		i += 1
	if cnt > ans:
		ans = cnt
	i += 1
print(ans)

Solution (Python):
S = input()
max = 0

if len(S) == 1:
    if S == 'A' or S == 'C' or S == 'G' or S == 'T':
        max = 1
    else:
        max = 0
    print(max)
    quit()


for i in range(len(S)-1):
    for j in range(i+1, len(S)+1):
        count = 0
        for char in S[i:j]:
            if char == 'A' or char == 'C' or char == 'G' or char == 'T':
                count += 1
            else:
                count = 0
                break
        if count > max:
            max = count

print(max)

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:
        cnt = 0
    if ans < cnt:
        ans = cnt

print(ans)

Solution (Python):
def isACGT(a):
    return a in ['A', 'C', 'G', 'T']

def main():
    n = input()
    max_len = 0
    for i in range(len(n)):
        cnt_len = 0
        if isACGT(n[i]):
            cnt_len += 1
            for j in range(i+1, len(n)):
                if isACGT(n[j]):
                    cnt_len += 1
                else:
                    break
        if cnt_len > max_len:
            max_len = cnt_len
    print(max_len)
if __name__ == '__main__':
    main()

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

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

Solution (Python):
s = input()

max = 0
count = 0
for c in s:
  if c in 'ACGT':
    count = count + 1
  else:
    count = 0
  if max < count:
    max = count
print(max)

Solution (Python):
s = input()
L = "ACGT"
ans = ""
ss = ""
for i in range(len(s)):
  if s[i] in L:
    ans += s[i]
    if i == len(s)-1:
        if len(ans)>len(ss):
            ss = ans
            
  else:
    if len(ans)>len(ss):
      
      ss = ans
      
      ans = ""
print(len(ss))

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

res = 0
for i in range(n):
    for j in range(i, n):
        sub = s[i: j+1]
        
        flg = True
        for c in sub:
            if(c not in ['A', 'G', 'C', 'T']): flg = False
        
        if(flg): res = max(res, len(sub))

print(res)

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

def atcg(s):
    slength = len(s)
    cnt = 0
    for i in range(slength):
        if s[i] == 'A' or s[i] == 'T' or s[i] == 'C' or s[i] == 'G':
            cnt +=1
        else:
            break
    return cnt

ans = []
for i in range(n):
    ans.append(atcg(s[i:]))


print(max(ans))

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

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

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

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

Solution (Python):
s = input()

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

ans = 0
ans_max = 0
flg = False
for c in s:
    if c in ACGT:
        ans += 1
        flg = True
    elif flg:
        ans_max = max(ans_max, ans)
        ans = 0
        flg = False

ans_max = max(ans_max, ans)

print(ans_max)

Solution (Python):
a = list(input())
ans = 0
count = 0
for i in a:

    if i == 'A':
        count +=1
    elif i == 'C':
        count+=1
    elif i == 'G':
        count+=1
    elif i == 'T':
        count+=1
    else:
        ans = max(ans ,count)
        count = 0

print(max(ans,count))

Solution (Python):
S = input()
n = len(S)
ans = 0
for i in range(n):
    for j in range(n):
        begin = i
        end = n-j
        if begin >=end:continue
        s = S[begin:end]
        ok = True
        for x in s:
            if x!='A' and x !='G' and x!='C' and x != 'T':
                ok = False
                break
        if ok:ans = max(ans,len(s))
print(ans)

Solution (Python):
S = list(input())
agct = ['A','G','C','T']
count = 0
max_count = 0
for key in S:
    if key in agct:
        count += 1
    else:
        max_count = max(max_count,count)
        count = 0
print(max(count,max_count))

Solution (Python):

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

s = readline()
n = len(s)
answer = 0
for i in range(n):
    for j in range(i, n):
        t = s[i:j + 1]
        if set(t) <= set('ACGT'):
            answer = max(answer, j - i + 1)
print(answer)

Solution (Python):

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

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

Solution (Python):




S = input()
n = len(S)

maxl = 0
for i in range(n):
    for j in range(i, n):
        for s in S[i:j+1]:
            if s not in 'ACGT':
                break
        else:
            if maxl < j-i+1:
                maxl = j-i+1

print(maxl)

Solution (Python):
s = input()

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

sub = []
for i in range(len(s)):
  for j in range(i+1,len(s)+1):
    tmp = s[i:j]
    flag = True
    for k in range(len(tmp)):
      if tmp[k] in lis:
        pass
      else:
        flag = False
    if flag: sub.append(tmp)
      
ma = 0
for i in sub:
  l = len(i)
  if l > ma: ma = l
print(ma)

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

Solution (Python):
s = input()

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

Solution (Python):
S = input()
c = 0
MAX = 0

for i in S:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        c += 1
        if MAX < c:
            MAX = c

    else:
        c = 0

print(MAX)

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

C = 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':
    C += 1
    ans = max(C,ans)
  else:
    C = 0

print(ans)

Solution (Python):
S = input()

ans = 0
temp = 0
for x in S:
    if x in ["A", "G", "C", "T"]:
        temp += 1
        ans = max(ans, temp)
    else:
        temp = 0

print(ans)

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

print(ans)

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

ans = max(ans, t)

print(ans)

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

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

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

if __name__ == '__main__':
    main()

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

def main():
    S = input()
    n = len(S)
    acgt = ['A', 'C', 'G', 'T']
    maxlen = 0
    for i in range(n):
        tmp = 0
        if S[i] in acgt:
            tmp += 1
            for j in range(i+1, n):
                if S[j] in acgt:
                    tmp += 1
                else:
                    break
            maxlen = max(maxlen, tmp)
    print(maxlen)

if __name__ == '__main__':
    main()

Solution (Python):
def solution():
    s = input()
    ans = len = 0
    for c in s:
        if c in 'ACGT':
            len += 1
            ans = max(ans, len)
        else:
            len = 0
    print(ans)

solution()

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

solution()

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

solution()

Solution (Python):
S=input()

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

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

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

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

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

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

print(max(arr))

Solution (Python):
s = input()
ans = 0
leng = 0
t = ('A','C','G','T')

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

Solution (Python):
import re

S = input()
S = re.sub('[^ACGT]', '_', S)
S = S.split('_')
ans = 0
for s in S:
    ans = max(ans, len(s))
print(ans)