Problem:
 Score : 200 points    Problem Statement You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S .  Here, a ACGT string is a string that contains no characters other than A , C , G and T .      Notes A substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T .  For example, the substrings of ATCODER include TCO , AT , CODER , ATCODER and (the empty string), but not AC .      Constraints  S is a string of length between 1 and 10 (inclusive).  Each character in S is an uppercase English letter.         Input Input is given from Standard Input in the following format:  S       Output Print the length of the longest ACGT string that is a substring of S .        Sample Input 1 ATCODER      Sample Output 1 3  Among the ACGT strings that are substrings of ATCODER , the longest one is ATC .       Sample Input 2 HATAGAYA      Sample Output 2 5  Among the ACGT strings that are substrings of HATAGAYA , the longest one is ATAGA .       Sample Input 3 SHINJUKU      Sample Output 3 0  Among the ACGT strings that are substrings of SHINJUKU , the longest one is (the empty string).

Solution (Python):
s=input()
c_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 c_max < count:
      c_max=count
    count=0

if c_max < count:
  c_max=count
print(c_max)

Solution (Python):
from itertools import combinations

S = input()
cands = [S[i:j] for i, j in combinations(range(len(S)+1), 2)]
ans = 0
for s in cands:
    flag = True
    for c in s:
        if c not in ['A', 'T', 'G', 'C']:
            flag = False
            break
    if flag and ans < len(s):
        ans = len(s)
print(ans)

Solution (Python):
S = input()

N = len(S)
ans = 0
for i in range(N):
    for j in range(i + 1, N + 1):
        T = S[i:j]
        flag = True
        for t in set(T):
            if t not in ['A', 'C', 'G', 'T']:
                flag = False
                break
        if flag:
            ans = max(ans, len(T))
print(ans)

Solution (Python):
s = input()
a = 0
t = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        t += 1
    else:
        if t > a:
            a = t
            t = 0
if t > a:
	a = t
print(a)

Solution (Python):
def solve(string):
    ans = 0
    i = 0
    while i < len(string):
        j = 0
        while i + j < len(string) and string[i + j] in "ATGC":
            j += 1
        ans = max(ans, j)
        i += j + 1
    return str(ans)
 
 
if __name__ == '__main__':
    print(solve(input()))

Solution (Python):
def solve(string):
    ans = 0
    i = 0
    while i < len(string):
        j = 0
        while i + j < len(string) and string[i + j] in "ATGC":
            j += 1
        ans = max(ans, j)
        i += j + 1
    return str(ans)
 
 
if __name__ == '__main__':
    print(solve(input()))

Solution (Python):
def solve(string):
    ans = 0
    i = 0
    while i < len(string):
        j = 0
        while i + j < len(string) and string[i + j] in "ATGC":
            j += 1
        ans = max(ans, j)
        i += j + 1
    return str(ans)
 
 
if __name__ == '__main__':
    print(solve(input()))

Solution (Python):
def solve(string):
    ans = 0
    i = 0
    while i < len(string):
        j = 0
        while i + j < len(string) and string[i + j] in "ATGC":
            j += 1
        ans = max(ans, j)
        i += j + 1
    return str(ans)


if __name__ == '__main__':
    print(solve(input()))

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

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

Solution (Python):

s = input()
n = len(s)
count = 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]):
            count = max(count, j - i + 1)

print(count)

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

Solution (Python):
import sys

input = sys.stdin.readline

s = list(input().rstrip())

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

for i in range(len(s)):
    for j in range(4):
        if (s[i] == lis[j]):
            s[i] = 'AYATASO'
            break

ct = 0
ct_lis = []

for i, x in enumerate(s):
    if (x == 'AYATASO'):
        ct += 1
    else:
        ct_lis.append(ct)
        ct = 0

ct_lis.append(ct)

print(max(ct_lis))

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

S = input()

tmp = []
tmp.append(-1)
for i, x in enumerate(S):
	if x != "A" and x != "T" and x != "G" and x != "C":
		tmp.append(i)
tmp.append(len(S))

tmp2 = [tmp[i+1]-tmp[i] for i in range(len(tmp)-1)]
print(max(tmp2)-1)

Solution (Python):
s=input()
tmpstr=0
maxstr=0
for chara in s:
    if chara=="A" or chara=="C" or chara=="G" or chara=="T":
        tmpstr+=1
        if tmpstr>=maxstr:
            maxstr=tmpstr
    else:
        tmpstr=0
print(maxstr)

Solution (Python):
S = input()
atgc = ['A','T','G','C']
flag = True
count = 0
max = 0

for c in S:
  if (c in atgc):
    flag = True
    if not flag:
      count = 0
    count += 1
    if max < count:
      max = count
  else:
    flag = False
    count = 0
    
print(max)

Solution (Python):
s = input()
max_len = 0

for i in range(len(s)):
    for j in range(i, len(s)+1):
        s_cut = s[i:j]
        if len(s_cut.replace('A','').replace('C','').replace('G','').replace('T','')) == 0 and len(s_cut) > max_len:
            max_len = len(s_cut)

print(max_len)

Solution (Python):
S=input()

c=m=0
for x in S:
  
  if "ACGT".find(x)>=0:
    c+=1
    m = max(m, c)
  else:
    c = 0

print(m)

Solution (Python):
s=input()
a=len(s)
b=[0]
c=0
for i in range(a):
  if s[i]in"ACGT":
    for j in range(a-i):
      if s[i+j]in"ACGT":
        c+=1
      else:
        break
    b.append(c)
    c=0
print(max(b))

Solution (Python):


import re

S = re.sub("[ACGT]", "-", input())

for i in range(1, 12):
    if not ("-" * i) in S:
        print(i - 1)
        break

Solution (Python):
import sys

S = list(input())

length = 0
maxlen = 0

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

print(maxlen)

Solution (Python):
S = input()

l = 0
a = 0
for ch in S:
    if ch in 'ACGT':
        l += 1
        a = max(a, l)
    else:
        l = 0
print(a)

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

Solution (Python):
S = input()
tmplen = 0
atclen = 0
for i in range(len(S)):
  if S[i]== "A" or S[i]=="T" or S[i]=="G" or S[i]=="C":
    tmplen = tmplen + 1
  else:
    if(atclen < tmplen):
      atclen = tmplen
    tmplen = 0
if(atclen<tmplen):
    atclen = tmplen
print(atclen)

Solution (Python):
S = input()

ans = 0
k = 0
for c in S:
    if c in "ATGC":
        k += 1
    else:
        k = 0
    ans = max(ans, k)
print(ans)

Solution (Python):
S = input()
l = []
for i in S:
    l.append(i)

c = 0
cnt = []
for j in range(len(l)):
    if l[j] == 'A' or l[j] == 'T' or l[j] == 'C' or l[j] == 'G':
        c+=1
        cnt.append(c)
    else:
        cnt.append(c)
        c = 0


print(max(cnt))

Solution (Python):
S = list(input())
st = [0]*len(S)
string = "ACGT"
for i in range(len(S)):
    if S[i] in string:
        st[i] += 1

st_1 = [1]*len(S)

count = []
temp = 0

for i in range(len(st)):
    if st[i] == st_1[i]:
        temp += 1
    else:
        count.append(temp)
        temp = 0
    if i+1 == len(st):
        count.append(temp)
        

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

Solution (Python):
def main():
  S = input()
  argc = len(S)
  result = 0
  flg = 0
  for i in range(argc):
    if (flg == 0):
      leng = 0
      flg = 1
    if (S[i]=='A')or(S[i]=='C')or(S[i]=='G')or(S[i]=='T'):
      leng = leng + 1
      if leng > result:
        result = leng
    else:
      flg = 0
  print(result)
main()

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

for i in range(len(s)):
    cnt = 0
    j = 0
    while (s[i+j]=="A" or s[i+j]=="T" or s[i+j]=="G" or s[i+j]=="C"):
        cnt += 1
        j += 1
        if i+j>=len(s):
            break
    lenlis += [cnt]

print(max(lenlis))

Solution (Python):
S = input()


c = [0 for _ in range(len(S))]

for i in range(len(S)):
    j = 0 
    while i + j < len(S) and S[i+j] in ["A", "C", "G", "T"]:
        c[i] += 1
        j += 1
        
print(max(c))

Solution (Python):
if __name__ =="__main__":
    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):
a = "ACGT"
S = input()
cnt = 0
ans = 0

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

print(ans)

Solution (Python):
s = input()
n = len(s)
A = {"A", "T", "G", "C"}
res = 0
for i in range(n):
    for j in range(i+1, n+1):
        ck = True
        for k in range(i, j):
            if not s[k] in A:
                ck = False
                break
        if ck:
            res = max(res, j-i)

print(res)

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

i = 0
j = 0
for c in t:
  if c in acgt:
    i += 1
  else:
    j = max(i,j)
    i = 0

print(max(i,j))

Solution (Python):


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

count = 0
length = 0

for i in s:
    if i in t:
        count += 1
    elif count > length:
        length = count
        count = 0

print(count) if count > length else print(length)

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

Solution (Python):
str = input()
max = 0
count = 0
for chr in str:
    if chr == 'A' or chr == 'C' or chr == 'G' or chr == 'T':
        count += 1
        if count > max:
            max = count
    else:
        count = 0
print('{}'.format(max))

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

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

Solution (Python):
S = input()

S = ''.join(s if s in 'ACGT' else ' ' for s in S)
m = max((len(s) for s in S.split()), default=0)
print(m)

Solution (Python):
import re
s = input()
m = re.findall(r"([ACGT]+)", s)
print(len(max(m, key=len)) if m else 0)

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

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

Solution (Python):
a = [str(i) for i in 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 += 1
        if b > c:
            c = b
    else:
        b = 0

print(c)

Solution (Python):
import re
s=input()
s=s.replace("A","1").replace("C","1").replace("G","1").replace("T","1")
s=list(map(int,re.sub('[A-Z]+', ' ', s).split()))
print(0 if s==[] else len(str(max(s))))

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

Solution (Python):
s = input()
a = "ATCG"
m = [0]
for i in range(len(s)):
    if s[i] in a:
        j = i + 1
        niz = 1
        while j < len(s) and s[j] in a:
            niz += 1
            j += 1
        m.append(niz)
print(max(m))

Solution (Python):
S = input()

allowed = set(list('ATCG'))

ans = 0
curstreak = 0
flag = False

for char in S:
    if char in allowed:

        if flag:
            curstreak += 1
        else:
            flag = True
            curstreak = 1
        
        ans = max(ans, curstreak)

    else:
        if flag:
            flag = False
            curstreak = 0

print(ans)

Solution (Python):
s = input()

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

  if c < t:
    c = t

print(c)

Solution (Python):
s = input()
char_list = ["A","C","G","T"]
temp = 0
now_max = 0

for char in s:
    if char in char_list:
        temp = temp + 1
    else:
        now_max = max(now_max,temp)
        temp = 0

now_max = max(now_max,temp)
print(now_max)

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

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

max_count = 0
interim = 0

while list_s != []:
  for c in list_s:
    if c == 'A' or c =='T' or c == 'C' or c == 'G':
      interim += 1
    else:
      break
  if max_count < interim:
    max_count = interim
  list_s.pop(0)
  interim = 0
  
print (max_count)

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()
b=[]
count=0
for i in range(len(s)):
  if s[i] in "ATCG":
    count+=1
  else:
    b.append(count)
    count=0
b.append(count)
print(max(b))

Solution (Python):


import re

s = input()

result = re.sub(r'[^ATGC]', ',', s).split(',')

print(max([len(i) for i in result]))

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

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

Solution (Python):
"""
B - ATCoder
https://atcoder.jp/contests/abc122/tasks/abc122_b
"""
if __name__ == '__main__':
    S = str(input())

    length = 0
    answer = 0
    for e in S:
        if e in 'ACGT':
            length += 1
            answer = max(answer, length)
        else:
            length = 0

    print(answer)

Solution (Python):
"""
B - ATCoder
https://atcoder.jp/contests/abc122/tasks/abc122_b
"""
if __name__ == '__main__':
    input = str(input())
    i_list = list(input)

    for i, e in enumerate(i_list):
        if e in {'A', 'C','G', 'T'}:
            i_list[i] = '1'
        else:
            i_list[i] = '0'

    c_list = ''.join(i_list).split('0')
    answer = len(max(c_list, key = len))

    print(answer)

Solution (Python):
S = str(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())
atcg = "ATCG"
count = 0
count_max = 0
for x in S:
    if x in atcg:
        count += 1
    else:
        if count_max <= count:
            count_max = count
        count = 0

if count_max <= count:
    count_max = count

print(count_max)

Solution (Python):
S = str(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())
atcg = "ATCG"
count = 0
count_max = 0
for x in S:
    if x in atcg:
        count += 1
    else:
        if count_max <= count:
            count_max = count
        count = 0
if count_max <= count:
  count_max = count
print(count_max)

Solution (Python):
S = input()
flag = 0
count = 0
for i in range(len(S)+1):
    for j in range(i+1, len(S)+1):
        flag = 1
        tmp = S[i:j]
        for k in range(len(tmp)):
            if tmp[k] == 'A' or tmp[k] == 'C' or tmp[k] == 'G' or tmp[k] == 'T':
                flag = 0
            else:
                flag = 1
                break
        if (flag == 0) and len(tmp) > count:
            count = len(tmp)

print(count)

Solution (Python):
S = list(input())
N = len(S)
count=0
count_max=0

for i in range(N):
    if S[i] == 'A' or S[i]=='T' or S[i]=='C' or S[i]=='G':
        count = count + 1
        count_max=max(count_max,count)
    else :
        count = 0
        continue

print(count_max)

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

print(ans)

Solution (Python):
n = input()

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

Solution (Python):
a = input()
from itertools import groupby

x = lambda x: x in 'ACGT'
print(max(len(list(g)) if k else 0 for k, g in groupby(a, key=x)))

Solution (Python):
s=input()
count,max_count=0,0
for t in s:
    if t in ["A","C","G","T"]:
        count+=1
        if max_count<count:
            max_count=count
    else:
        count=0
print(max_count)

Solution (Python):



S = raw_input()
num = 0
max_num = 0

for s_id in range(len(S)):
    if S[s_id] == 'A' or S[s_id] == 'T' or S[s_id] == 'C' or S[s_id] == 'G':
        num += 1
    else:
        if num != 0 and max_num < num:
            max_num = num
            num = 0

    if s_id == len(S) - 1 and num != 0 and max_num < num:
        max_num = num

print '{}'.format(max_num)

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

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

length = len(S)
ans = 0
tmp = 0

for i in range(length):
  if S[i] in gene:
    tmp += 1
  else:
    tmp = 0
  if tmp >= ans:
    ans = tmp
print(ans)

Solution (Python):
import sys
T = sys.stdin.readline().rstrip('\n')
s = ['A','C','G','T']

out = 0
tmp = 0

l = len(T)

for i in range(l):
	if T[i] in s:
		tmp += 1
	else:
		tmp = 0

	if tmp >= out:
		out = tmp

print (out)

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

length = len(s)
ans = 0
tmp = 0
for i in range(length):
    if s[i] in gene:
        tmp += 1
    else:
        tmp = 0
    
    if tmp >= ans :
        ans = tmp

print(ans)

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

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

if s.count(1) == 0:
  print(0)
  exit()

n=0
for i in range(len(s)):
  if s[i] == 1:
    s[i]=n
    n += 1
  else:
    n = 0
    s[i]=n

print(max(s)+1)

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

ans = 0
i = 0

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

Solution (Python):
S = input()
nagasa = len(S)
ichi_list = []
counter = 0
for i in range(nagasa):
    if S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G':
        counter += 1
    else:
        ichi_list.append(counter)
        counter = 0

ichi_list.append(counter)
print(max(ichi_list))

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

res = 0
max = 0
for i in s:
  if i == 'A' or i == 'T' or i == 'C' or i == 'G':
    res += 1
  elif max <res:
    max = res
    res = 0
  else:
    res = 0

if max < res:
  max = res

print(max)

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

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

Solution (Python):
b=input()
max = 0
count = 0

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

Solution (Python):
S = input()
mojiretsu = ["A","C","G","T"]
s_bin = [int(s in mojiretsu) for s in S]

cnt = 0
cnt_max = 0
for s in s_bin+[0]:
    if s == 0:
        
        cnt = 0
    if s == 1:
        cnt += 1
        cnt_max = max(cnt_max, cnt)
    
    

print(cnt_max)

Solution (Python):


l = list(input())
counter = 0
atcorder = []


for i in range(len(l)):
    if(l[i] == "A" or l[i] == "T" or l[i] == "G" or l[i] == "C"):
        counter += 1
        atcorder.append(counter)
        continue

    counter = 0


if(len(atcorder) != 0):
    print(max(atcorder))
else:
    print("0")

Solution (Python):

arg=input()
x=len(arg)
count=0
d=[0]

for i in arg:
    if(i=="A" or i=="C" or i=="G" or i=="T"):
        count=count+1
        d.append(count)
    else:
        count=0

print(max(d))

Solution (Python):
S=str(input())
cnt=0
maxcnt=0
for i in S:
    if(i=="A" or i=="C" or i=="G" or i=="T"):
        cnt+=1
    else:
        if(maxcnt<cnt):
            maxcnt=cnt
        cnt=0
if(maxcnt<cnt):
    maxcnt=cnt
print(maxcnt)

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

for i in S:
    if i == 'A' or i == 'T' or i == 'C' or i == 'G':
        counter += 1
        if counter >= max:
            max = counter
    else:
        counter = 0

print(max)

Solution (Python):
str = input()

max = 0
cnt = 0
for i in str:
  if (i == 'A' or i == 'C' or i == 'G' or i == 'T'):
    cnt += 1
    if (cnt >= max):
      max = cnt
  else:
    cnt = 0

print(max)

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

L = []
cnt = 0

for x in s:
    if x == "A" or x == "C" or x == "G" or x == "T":
        cnt += 1
    else:
        L.append(cnt)
        cnt = 0
L.append(cnt)

print(max(L))

Solution (Python):
s = input()
t = [-1]

for i in range(len(s)):
    if s[i] != "A" and s[i] != "G" and s[i] != "C" and s[i] != "T":
        t.append(i)
t.append(len(s))

ans = 0
for j in range(len(t) - 1):
    x = t[j+1] - t[j] - 1
    if x > ans:
        ans = x

print(ans)

Solution (Python):
T = input()
count, temp = [], 0
AGCT = ['A', 'G', 'C', 'T']
for i in T:
  if (i in AGCT) == True:
    temp += 1
  else:
    count.append(temp)
    temp = 0
count.append(temp)
print(max(count))

Solution (Python):
import sys

def i2s():
    return sys.stdin.readline().rstrip()

def ii2ss(n):
    return [sys.stdin.readline() for _ in range(n)]

def sp2nn(sp, sep=' '):
    return [int(s) for s in sp.split(sep)]

def ss2nn(ss):
    return [int(s) for s in list(ss)]

def main(S):
    st = set(('A', 'C', 'G', 'T'))
    cmax = 0
    c = 0
    for s in S:
        if s in st:
            c += 1
        else:
            if cmax < c:
                cmax = c
            c = 0
    if cmax < c:
        cmax = c
    print(cmax)

main(i2s())

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

Solution (Python):
s = str(input())
i = 0
ans = [] 

for let in s:
  if let == "A" or let == "T" or let == "G" or let == "C":
    i += 1
  else:
    ans.append(i)
    i = 0
ans.append(i)    
print(max(ans))

Solution (Python):
S = (input())
k=0
j=0
for  chr in S:
    if (chr=='A')or(chr=='C')or(chr=='G')or(chr=='T'):
        j=j+1
    else:
        if k<j:
            k=j
        j=0
if k<j:
    k=j
print(k)

Solution (Python):
a=input()
k=0
ans=0
for b in a:
    if (b=='A')or(b=='C')or(b=='G')or(b=='T'):
        k=k+1
    
    else:
        if ans<k:
            ans=k
        k=0
if ans<k:
	ans=k
print(ans)

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

Solution (Python):
acgt=["A", "C", "G", "T"]
s=list(raw_input())
a=[-1]
maxL=0
for pos in range(len(s)):
   if s[pos] not in acgt:
       a.append(pos)
a.append(len(s))
for pos in range(1,len(a)):
   L=a[pos]-a[pos-1]-1
   if L>maxL:
       maxL=L
print(maxL)

Solution (Python):
print(len(max("".join(str(int(c in"ATGC"))for c in input()).split("0"))))

Solution (Python):
print(len(max("".join(str(int(c in{"A","T","G","C"}))for c in input()).split("0"))))

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

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

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

Solution (Python):



def main():
    sample = raw_input()
    arr = []
    length = 0
    ans = 0
    for s in sample:
        arr.append(s)
    for t in arr:
        if t == 'A' or t == 'C' or t == 'G' or t == 'T':
            length += 1
        else:
            if ans < length:
                ans = length
                length = 0
    if ans < length:
        ans = length
        length = 0
    return ans

print(main())

Solution (Python):
ref=input()
count=0
count_list=[]
seq=["A","T","G","C"]
for base in ref:
    if base in seq:
        count +=1
       
    else:
        count_list.append(count)
        count =0
    count_list.append(count)

print(max(count_list))

Solution (Python):
s=str(input())
count=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':
    count += 1
  else:
    count=0
  if count>tmp:
    tmp=count
print(tmp)

Solution (Python):
s = str(input())
a = "ACGT"
count = 0
b = []
for i in s:
  if i in a:
    count += 1
    b.append(count)
  else:
    b.append(count)
    count = 0
print(max(b))

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

Solution (Python):
string = input().strip()

longest = 0
current = 0

for s in string:
    if s in ('A', 'T', 'G', 'C'):
        current += 1
        if current > longest:
            longest = current
    elif current > 0:
        current = 0

print(longest)

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

Solution (Python):
a = list(input())
b = 0
c = 0

for i in range(len(a)):
  if(a[i] == "A" or a[i] == "G" or a[i] == "T" or a[i] == "C"):
    b += 1
    if(b > c):
      c = b
  else:
    b = 0

print(c)

Solution (Python):
a = input()
ans = 0
for i in range(len(a) + 1):
  str_a = a[(i):]
  for j in range(len(str_a)):
    str_b = str_a[:len(str_a) - j]
    tmp_mess = str_b.replace('A','').replace('C','').replace('G','').replace('T', '')
    if (tmp_mess == ''):
      if (ans <= len(str_b)):
        ans = len(str_b)
print(ans)

Solution (Python):
import sys

arg = input()
scavenger=''
warehouse=[]
longest=0
i=0

for tmp in arg[0:]:
  if tmp=='A' or tmp=='T' or tmp=='C' or tmp=='G':
    scavenger=scavenger+tmp
  else:
    warehouse.append(scavenger)
    scavenger=''

warehouse.append(scavenger)

for tmp in warehouse[0:]:
  if len(tmp)>longest:
    longest=len(tmp)

print(longest)

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

    if k > max:
        max = k

print(max)

Solution (Python):
data=[]
for i in input():
  data.append(i)
  
N=0
maxa=0

for j in range(len(data)):
  if data[j]=="A" or data[j]=="C" or data[j]=="G" or data[j]=="T":
    N=N+1
    if N>maxa:
      maxa=N
  else:
    N=0

print(maxa)

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

Solution (Python):
S = input()
cnt = 0
ans = 0
for s in S:
    if s in "ATCG":
        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":
        cnt+=1
    elif s in "C":
        cnt+=1
    elif s in "G":
        cnt+=1
    elif s in "T":
        cnt+=1   
    else:
        cnt=0
    ans=max(ans,cnt)
print(ans)

Solution (Python):
mx, h = [], []
for ch in str(input()):
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    mx += [h]
    print(max([len(l) for l in mx]))

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()
N = len(S)
ans = 0 
for i in range(N):
  for j in range(i,N):
    if all("AGCT".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
cnt=0
for i in s:
    if (i == 'A') or (i == 'C') or (i == 'G') or (i == 'T'):
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
ans = max(ans, cnt)
print(ans)

Solution (Python):
S = input()

acgt_set = {'A', 'C', 'G', 'T'}
length = []

count = 0
for i, s in enumerate(S):
    if s in acgt_set:
        count += 1
        if i == len(S) - 1:
            length.append(count)
    else:
        length.append(count)
        count = 0

print(max(length))

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

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

print(ma)