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 re

s = input()
n = len(s)
res = 0
for i in range(0, n):
    j = i
    tempres = 0
    while j < n and (s[j] == "A" or s[j] == "G" or s[j] == "C" or s[j] == "T"):
        j += 1
        tempres += 1
    res = max(res, tempres)

print(res)

Solution (Python):
def func():
    S = input()

    target = ["A", "G", "C", "T"]
    mx = 0
    count = 0
    for ch in S:
        if ch in target:
            count += 1
        else:
            mx = max(mx, count)
            count = 0
    
    mx = max(mx, count)
    print(mx)


if __name__ == '__main__':
    func()

Solution (Python):
S = list(input().strip())
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()

a=set("ACGT")

ans=0
b=[0]

for i in range(len(s)):
  if s[i] in a:
    ans+=1
    b.append(ans)
  else:
    ans=0

print(max(b))

Solution (Python):
s= input()

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

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

Solution (Python):
S = input()

max_len = 0
memo_len = 0
flag = True

for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="G" or S[i]=="C":
        if flag == True:
            memo_len += 1
        else:
            memo_len = 1
            flag = True
    else:
        if max_len < memo_len:
            max_len = memo_len
        flag = False
        
if max_len < memo_len:
    max_len = memo_len
print(max_len)

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

Solution (Python):
s = input().strip()
n = len(s)
res = 0
left = 0
right = 0
while left < n:
    if s[left] not in ['A', 'T', 'C', 'G']:
        left += 1
        continue
    right = left + 1
    while right < n:
        if s[right] in ['A', 'T', 'C', 'G']:
            right += 1
        else:
            break
    res = max(res, right - left)
    left = right
print(res)

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

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

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

Solution (Python):
str = list(input())
n = len(str)
max = 0
counter = [0,0,0]
for i in range(n):
  if 'A' in str[i] or 'T'in str[i] or 'C' in str[i]or 'G'in str[i]:
    counter.insert(i, counter[i] + 1)
  else:
    counter.append(0)
  

con = 0;    
for i in range(n+1):
  if counter[i] == 1:
    con += 1
    continue
  else :
    if con > max :
      max = con
      con = 0
    
print(max)

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

Solution (Python):
s = list(input())
i=0
li = [0]
num = 0
while i<=len(s)-1:
    
    s1 = ["A","C","G","T"]
    
    if s[i] in s1 :
        num += 1
        i += 1
        li.append(num)
    elif s[i] not in s1 :
        num = 0
        i += 1
        
print(max(li))

Solution (Python):
s=input()

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

Solution (Python):
s = str(input())
s +='0'
result = [0]
i = 0
counter = 0
while i+counter < len(s):
    counter = 0
    h = 1
    while i + counter < len(s) and h == 1:
        if s[i+counter] == 'A' or s[i+counter] == 'T' or s[i+counter] == 'G' or s[i+counter] == 'C':
            counter += 1
        else:
            result.append(counter)
            i += counter +1
            h = 0
print(max(result))

Solution (Python):
s = input()

s += "X"
pat = ["A", "C", "G", "T"]
mx = 0
count = 0

for i in range(len(s)):
    if s[i] in pat:
        count += 1
    else:
        if count > mx:
            mx = count
        count = 0

print(mx)

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

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 = list(str(input()))
atgc = ["A","T","G","C"]
cout = 0
a = [0]
for i in range(len(S)):
    if S[i] in atgc:
        cout+=1
    else: 
        if cout>0:
            a.append(cout)
            cout = 0
a.append(cout)
ans = max(a)
print(ans)

Solution (Python):
s = list(input())
s.append('end')
lst = ['A', 'T', 'G', 'C']
max_len = 0
cnt = 1
for i in range(len(s)-1):
    if s[i] in lst:
        if s[i+1] in lst:
            cnt += 1
        else:
            if max_len < cnt:
                max_len = cnt
            cnt = 1
print(max_len)

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

for i in range(len(s)):
    flag = True
    tmp=0
    for j in range(i,len(s)):
        if s[j] not in ACGT:
            flag = False
            break
        tmp += 1
    ans=max(ans,tmp)

print(ans)

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

Solution (Python):
s= input()

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

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

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

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

ans=0
for i in range(len(s)):
  for j in range(i+1,len(s)+1):
    cnt=0
    for tmp in s[i:j]:
      if tmp not in acgt:
        break
      cnt+=1
    ans=max(ans,cnt)
print(ans)

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

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

    print(ans)



main()

Solution (Python):
s = input()
m = 0
count = 0

for x in s:
    if x in 'A':
        count +=1
    elif x in 'C':
        count +=1
    elif x in 'G':
        count +=1
    elif x in 'T':
        count +=1
    else:
        count = 0
    m = max(m,count)
print(m)

Solution (Python):
s = input()
score = 0
count = 0

for i in range(len(s)):
    if s[i] in "ACGT":
        score += 1
        count = max(count,score)
    else:
        score = 0

print(count)

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

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

Solution (Python):

s = input()
max = ''
for i in range(len(s)):
    for j in range(len(s)):
        flag = True
        judge = s[i:j+1]
        for k in judge:
            if k != "A" and k != "C" and k != "G" and k != "T":
                flag = False
                break
        if flag and len(judge) > len(max):
            max = judge
print(len(max))

Solution (Python):
S = input()
ACGT = ['A', 'C', 'G', 'T']
count = 0
max_count = 0
for w in S:
    if w in ACGT:
        count += 1
    if count > max_count:
        max_count = count
    if w not in ACGT:
        count = 0
print(max_count)

Solution (Python):
S = input()
L = ["A", "C", "G", "T"]

max_ = 0
cnt = 0
f = False
for n in range(len(S)):
    if (not f) and S[n] in L:
       cnt = 1
       f = True
    elif not f:
        pass
    elif f and S[n] in L:
        cnt += 1
    else:
        max_ = max(max_, cnt)
        cnt = 0
        f = False

print (max(max_, cnt))

Solution (Python):
s = input()
acgt = "ACGT"
c = 0
c_max = 0

for i in s:
    if i in acgt:
        c += 1
        if c > c_max:
            c_max = c
    else:
        c = 0

print(c_max)

Solution (Python):
S = list(input())
n = len(S)
m = 0
for i in range(n):
    for j in range(i + 1, n + 1):
        if j - i > m and all(s in "ACGT" for s in S[i:j]):
            m = j - i
print(m)

Solution (Python):
S = input()
L = ["A", "C", "G", "T"]

arr = []
st = ""

for s in S:
    if st and s not in L:
        st = ""
    if s in L:
        st += s
        arr.append(st)

print(max(map(len, arr)) if arr else 0)

Solution (Python):

import re

def main():
    S = input()
    regex = r"[ATCG]*"
    matches = re.findall(regex, S)

    ans = 0
    for match in matches:
        if len(match) > ans:
            ans = len(match)
    return ans

if __name__ == '__main__':
    print(main())

Solution (Python):
S = input()

helix = ["A","T","C","G"]
ans = 0
tmp = 0
for s in S:
    if s in helix:
        tmp += 1
        if tmp > ans:
            ans = tmp
    else:
        tmp = 0
print(ans)

Solution (Python):
s = input()
a = ['A', 'C', 'G', 'T'] 
i, tmp, ans = 0, 0, 0
while i < len(s):
  if s[i] in a:
    tmp += 1
    i += 1
    if tmp > ans:
      ans = tmp
  else:
    tmp = 0
    i += 1
print(ans)

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

Solution (Python):
S = input()
length = 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
    length = max(length, tmp)
print(length)

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

s=input().split()
s=list(s[0])
length=len(s)
ans=0
for i in range(length):
    cnt=0
    for j in range(i, length):
        if s[j]=="A"or s[j]=="C"or s[j]=="G"or s[j]=="T":
            cnt+=1
        else:
            break
        ans=max(ans,cnt)

print(ans)

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

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

Solution (Python):
S = input()
check = {'A', 'T', 'G', 'C'}
ans = 0
count = 0
for s in S:
    if s in check:
        count += 1
    else:
        ans = max(ans, count)
        count = 0
ans = max(ans, count)

print(ans)

Solution (Python):
S=input()
m=0
count=0
for s in S:
    if s in "AGCT":count+=1
    else:count=0
    m=max(m,count)
print(m)

Solution (Python):
S = input()

from collections import deque

answer = 0
queue = deque()
target = {'A','C','G','T'}
for s in S:
    if s in target:
        queue.append(s)
    else:
        answer = max(answer, len(queue))
        queue.clear()
answer = max(answer, len(queue))
print(answer)

Solution (Python):
s = input()

acgt = {"A", "C", "G", "T"}
converted = ""
for char in s:
    if char in acgt:
        converted += "1"
    else:
        converted += " "

substrs = [len(substr) for substr in converted.split()]
answer = 0 if len(substrs) < 1 else max(substrs)
print(answer)

Solution (Python):
S = list(input())
s = {'A', 'C', 'G', 'T'}
ans = pa = 0
for i in range(len(S)):
    if S[i] in s:
        pa += 1
        if pa > ans:
            ans = pa
    else:
        pa = 0
print(ans)

Solution (Python):
S = input()
def check_ACGT(char):
    for c in list(char):
        if c not in {"A","C","G","T"}:
            return False
    return True
max_len = 0
for start in range(len(S)):
    for end in range(start,len(S)):
        bubun_S = S[start:end+1]
        if check_ACGT(bubun_S):
            if len(bubun_S)>max_len:
                max_len = len(bubun_S)

print(max_len)

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

Solution (Python):
s = input()

res = 0
tmp = 0
for i in range(len(s)):
    if s[i] in 'ACGT':
        tmp += 1
    else:
        res = max(res, tmp)
        tmp = 0

    if i == len(s) - 1:
        res = max(res, tmp)

print(res)

Solution (Python):
s = input()
a = [str(c) for c in s]
before = 0
cnt = 0

for i in a:
  if i in ["A","C","G","T"]:
    cnt += 1
    if cnt > before:
        before = cnt
  else:
    cnt = 0

print(before)

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

Solution (Python):
s = input()
maxlen = 0
l = 0
for c in s:
    if c in 'ATGC':
        l += 1
    else:
        maxlen = max(maxlen, l)
        l = 0
maxlen = max(maxlen, l)
print(maxlen)

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

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

Solution (Python):
N = input()
a=0
b=0
for i in range(len(N)):
	if N[i] == 'A' or N[i] ==  'T' or N[i] ==  'C' or N[i] ==  'G' :
		a+=1
	else: 
		if a > b: b = a
		a=0

print(max(b,a))

Solution (Python):
s = input()
atgc = 'ATGC'
for x in s:
    if x not in atgc:
        s = s.replace(x, ' ')
print(max(list(map(len, s.split()))+[0]))

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

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

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

Solution (Python):
import re

def test():
    s = input()
    n = len(s)
    str = "[^ACGT]"
    a = []
    result = 0
    for i in range(n):
        a.append(s[i])
        b = "".join(a)
        c = re.findall(str,b)
        if c:
            a.clear()
        else:
            result = max(result,len(a))

    print(result)


if __name__ == "__main__":
    test()

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

Solution (Python):
m = a = 0
for c in input():
    if c in "ATGC": m+=1
    else: a = max(a, m); m = 0
else: print(max(a, m))

Solution (Python):
s=list(map(str,input()))
for i in range(len(s)):
    s[i]='1' if (s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T') else '0'
print(len(max(''.join(s).split('0'),key=len)))

Solution (Python):
s = input()



s = s.replace('A','*')
s = s.replace('C','*')
s = s.replace('G','*')
s = s.replace('T','*')

for i in range(len(s)):
    
    if s[i] != '*':
        
        if i != len(s):
            s = s[:i]+'?'+s[i+1:]
        else:
            s = s[:i]+'?'
        
    

sl = s.split('?')

sl.sort()

if sl:
    print(len(sl[-1]))
else:
    print(0)

Solution (Python):
def main():
    S = input()
    count = 0
    max_count = 0
    for i in range(len(S)):
        if S[i] in "ATCG":
            count += 1
            max_count = max(max_count, count)
        else:
            count = 0
    return max_count

if __name__ == '__main__':
    print(main())

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


T = input()
ACGT = set(["A", "C", "G", "T"])
num = 0
nummax = 0
for i in range(len(T)):
	if T[i] in ACGT:
		num += 1
		nummax = max(nummax, num)
	else:
		num = 0

print(nummax)

Solution (Python):
text = input()
dict = ["A", "T", "G", "C"]
cnt = 0
max = 0
for s in text:
    if s in dict:
        cnt += 1
        if cnt > max:
            max = cnt
    else:
        cnt = 0
print(max)

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

length = []
temp = 0
for i in S:
    if (i == "A") or (i == "T") or (i == "G") or (i == "C"):
        temp += 1
        length.append(temp)
    else:
        length.append(0)
        temp = 0

print(max(length))

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

Solution (Python):
l = list(str(input()))
for i in range(len(l)):
    if l[i] == 'A' or l[i] == 'T' or l[i] == 'C' or l[i] == 'G':
        pass
    else:
        l[i] = ','
ll = "".join(l).split(',')
ans = max(len(ll[i]) for i in range(len(ll)))
print(ans)

Solution (Python):

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

Solution (Python):
N=list(input())
count = 0
Scount = 0

for i in N:
  if i == "A" or i == "C" or  i == "G" or  i == "T":
    count += 1
    Scount = max(Scount,count)
  else:
    count = 0

print(Scount)

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

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

Solution (Python):
import os,re,sys,operator,math
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy
import heapq
import string

setrecursionlimit(10**6)

s=stdin.readline().rstrip()
t="AGTC"
cnt,ans=0,0
for i in s:
    if i in t:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
ans=max(ans,cnt)
print(ans)

Solution (Python):
S=input()
r=0
c=0
for s in S:
    if s=='A'or s=='T'or s=='C'or s=='G':
        c+=1
        r=max(r,c)
    else:
        c=0
print(r)

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

Solution (Python):
s = list(input())
count = 0
m = 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
  else:
    if m < count:
      m = count
      count = 0
    else:
      count = 0
if m < count:
      m = count
print(m)

Solution (Python):
S = input()
A = [-2, -1]
for i in range(len(S)):
    A += [i]*(S[i] not in "ACGT")
A += len(S),
print(max([b-a for a, b in zip(A, A[1:])])-1)

Solution (Python):
s = input()
atgc = ("A","T","G","C")
maxlen = 0
for i in range(len(s)):
	cnt = 0
	if s[i] in atgc:
		cnt += 1
		for j in range(i+1,len(s)):
			if s[j] in atgc:
				cnt += 1
			else:
				break
	if cnt > maxlen:
		maxlen = cnt
print(maxlen)

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

ans = max(ans, k)
print(ans)

Solution (Python):
s = input()

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

print(ans)

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

Solution (Python):
s=list(input())
cnt=[0 for _ in range(len(s))]
k=0
for i in range(len(s)):
    if(s[i]=="A" or s[i]=="G" or s[i]=="C" or s[i]=="T" ):
        cnt[k]+=1
    else:
        k+=1

print(max(cnt))

Solution (Python):
s = input()

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

print(ans)

Solution (Python):
print(max([sum(1 for _ in s[1]) if s[0] == 'A' else 0 for s in __import__('itertools').groupby(input().replace('T', 'A').replace('G', 'A').replace('C', 'A'))]))

Solution (Python):
s = input().split()[0]
acgt = ['A', 'C', 'G', 'T']

check_list = ['*' if char in acgt else '/' for char in s]
acgt_list = ''.join(check_list).split('/')
answer = max([len(x) for x in acgt_list])
print(answer)

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

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

Solution (Python):
s = input()
cnt = 0
Max = 0
ACGT = ["A","C","G","T"]
for i in s:
    if i in ACGT:
        cnt +=1
        Max = max(Max,cnt)
    else:
        cnt = 0
print(Max)

Solution (Python):
from re import findall
S = input()
f = findall('[ACGT]*',S)
l = map(len, f)
print(max(l))

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()
a = ["A", "G", "C", "T"]
ma = 0
for i in range(len(s)):
    if s[i] in a:
        cnt = 1
        ma = max(ma, cnt)
        for j in range(i+1, len(s)):
            if s[j] in a:
                cnt += 1
                ma = max(ma, cnt)
            else:
                break
print(ma)

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

Solution (Python):
s=list(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:
    count=0
  if max_<count:
      max_=count
print(max_)

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

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

print(max_cnt)

Solution (Python):
S = input()
maxlen = 0
top = 0
while top < len(S):
    c = top
    while c < len(S):
        if S[c] == 'A' or S[c] =='C' or S[c] == 'G' or S[c] == 'T':
            c += 1
        else:
            break
    if maxlen < c - top:
        maxlen = c - top
    top = c + 1

print(maxlen)

Solution (Python):
S = input()
ACGT=["A","C","G","T"]
for i in range(len(S)):
  if not S[i] in ACGT:
    S = S.replace(S[i],"-")
print(max(map(len,S.split("-"))))

Solution (Python):
import re

s = input()

results = re.findall(r'[ACGT]*', s)
print(max([len(r) for r in results]))

Solution (Python):
s=input()

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

Solution (Python):
s=input()

sub=list(s)

count=0
max=-1

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

if max!=-1:
    print(max)
else:
    print(0)

Solution (Python):
import math
import copy

inputa = input().split()







a = inputa[0]
inputList = list(a)














sum = 0
max = 0
ref = ["A", "C", "G", "T"]
for i in range(len(inputList)):
    flg = False
    for j in range(len(ref)):
        if inputList[i] == ref[j]:
            flg = True
            break

    if flg == False:
        if sum > max:
            max = sum
        sum = 0
    elif flg == True and i == len(inputList)-1:
        sum +=1
        if sum > max:
            max = sum
    elif flg == True:
        sum += 1
        
print(max)

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

Solution (Python):
s = input()

c = 0
m = 0
for i in s:
	if i in 'ACGT':
		c += 1
		m = max(c,m)
	else:
		c = 0

print(m)

Solution (Python):
s=input()
a=0
b=["A","C","G","T"]
k=0
for i in range(len(s)):
    if s[i] in b:
        k+=1
        if i==len(s)-1 and k>a:
            a=k
    else:
        if k>a:
            a=k
        k=0

print(a)

Solution (Python):



S = input()
array = ["A", "C", "G", "T"]
ctr, max_ctr = 0, 0

for i in range(len(S)):
    if S[i] in array:
        ctr += 1
        if max_ctr < ctr:
            max_ctr = ctr
    else: ctr = 0
    
print(max_ctr)

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

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

print(maximum)

Solution (Python):
s = input()
l = ['A', 'T', 'C', 'G']
r = 0
m = 0
for x in range(len(s)):
    if s[x] in l:
        r += 1
    elif r > 0:
        r = 0
    if m < r:
        m = r
print(m)

Solution (Python):
def solve():
    s = input()
    genom = ["A", "T", "G", "C"]
    count, ans = 0, 0
    for c in s:
        if c in genom:
            count += 1
            if count > ans:
                ans = count
        else:
            count = 0
    print(ans)


if __name__ == "__main__":
    solve()

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

m = ''.join(ans)
m2 = m.split('0')
mx = max(m2)
print(len(mx))

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

Solution (Python):
S = input()

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

i = 0
max = 0

while len(S) > i:
    count = 0
    for j in range(i,len(S)):
        hantei = 0
        for k in range(4):
            if S[j] == ACGT[k] :
                count += 1
                hantei = 1
                break
        if hantei == 0:
            break     
    if max < count:
        max = count
    i += 1

print(max)

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

max_length = 0
for i in range(len(S)):
  if S[i] in list:
    for j in range(i, len(S)):
      s = S[j]
      if s not in list:
        break
      else:
        str = S[i:j+1]
        if len(str) > max_length:
          max_length = len(str)

print(max_length)

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

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

Solution (Python):
s = input()

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

acgt_num = 0
answer = 0
for i in range(len(s)):
    for j in range(4):
        if s[i] == acgt[j]:
            acgt_num += 1
            if i == len(s) - 1 and acgt_num > answer:
                answer = acgt_num
            break
        elif j == 3:
            if acgt_num > answer:
                answer = acgt_num
            acgt_num = 0

print(answer)

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

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

cnt = []
c = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        c += 1
    else:
        cnt.append(c)
        c = 0
cnt.append(c)

print(max(cnt))

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

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

mm = 0
m = 0
for c in s:
    if c in a:
        m += 1
        mm = max(mm,m)
    else:
        m = 0

print(mm)

Solution (Python):
S=str(input())
N=len(S)
l,r=0,0
ans=0
while r<N:
	if S[r]=='A' or S[r]=='T' or S[r]=='C' or S[r]=='G':
		r=r+1
		ans=max(ans,r-l)
	else:
		l=r+1
		r=r+1
print(ans)

Solution (Python):
S = input()
N = len(S)
ans = 0
for l in range(N):
  i = 0
  while l + i < N and S[l + i] in ['A', 'T', 'G', 'C']:
    i += 1
  ans = max([ans, i])
print(ans)