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



Sample input:
ATCODER


Sample output:
3

Submission status: Runtime Error

Solution code:
S=input()
C=[]
count=0
for i in S:
    if i in {'A','C','G','T'}:
        count += 1
        continue
    elif i not in {'A','C','G','T'}:
        C.append(count)
        count=0
        continue
    
print(max(C))

Submission status: Runtime Error

Solution code:
s = input()
ans = 0
tmp = 0
acgt = ['A', 'C', 'G', 'T']
while s:
  if s.pop(0) in acgt:
    tmp += 1
  else:
    ans = max([ans, tmp])
    tmp = 0

ans = max([ans, tmp])
print(ans)

Submission status: Runtime Error

Solution code:

S = input()
ARR = ['A', 'C', 'G', 'T']

results = []
count = 0
for i in range(len(S)):
    if S[i] in ARR:
        count+=1
    else:
        results.append(count)
        count = 0
print(max(results))

Submission status: Runtime Error

Solution code:
l = []
c = 0
s = input()
for i in s:
    if i in 'ACGT':
        c += 1
        l += [c]
    else:
        c = 0
print(max(l))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#ATCGを小文字へ置き換え、小文字を抽出する作戦
S=input().replace("A","a").replace("T","t").replace("C","c").replace("G","g")

#小文字の列を取得
import re
list=re.findall(r"[a-z]+",S)

#各列の文字列の長さをリストに
list2=[]
for i in range(len(list)):
  list2.append(len(list[i]))

print(max(list2))

Submission status: Runtime Error

Solution code:
b = input()
ans = []
cnt = 0

for i in b:
    if i in "ACTG":
        cnt+=1
    else:
        ans.append(cnt)
        cnt = 0

print(max(ans))

Submission status: Runtime Error

Solution code:
b = input()
ans =0
cnt =0
 
for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0
 
print(ans)
b = input()
ans =0
cnt =0

for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0

print(ans)

Submission status: Runtime Error

Solution code:
b = input()
ans =0
cnt =0
 
for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0
 
print(ans)
b = input()
ans =0
cnt =0

for i in b:
    if i == 'A':
        cnt+=1
    elif i == 'T':
        cnt+=1
    elif i == 'C':
        cnt+=1
    elif i == 'G':
        cnt+=1
    else:
        if ans < cnt:
            ans = cnt
        cnt = 0

print(ans)

Submission status: Runtime Error

Solution code:
ls=list(input())
ans=0
ans_ls=[]
for i in range(len(ls)):
    if ls[i ]=='A' or ls[i] == 'C' or ls[i] == 'G' or ls[i] == 'T':
        ans=ans+1
    else:
        ans1=ans
        ans_ls.append(ans1)
        ans=0

print(max(ans_ls))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
acgt = ["A", "C", "G", "T"]
cnts = []
tmp = 0
for i in range(len(S)):
	if S[i] in acgt:
		tmp += 1
	else:
		cnts.append(tmp)
		tmp = 0
print(max(cnts))

Submission status: Runtime Error

Solution code:
import re
s=input()
r=[0]
for i in re.finditer("[ACGT]+", s):
    r.append(len(i[0]))
print(max(r))

Submission status: Runtime Error

Solution code:
import re
regex=(r'[A|C|G|T]+')
s=input()
mo=re.search(regex,s)
print(len(mo.group()))

Submission status: Runtime Error

Solution code:
SHINJUKU

Submission status: Runtime Error

Solution code:
agct = {"A":"T","G":"C","T":"A","C":"G"}
a = input()
print(agct[a])

Submission status: Runtime Error

Solution code:
agct = {"A":"T","G":"C","T":"A","C":"G"}
print(agct[input()])

Submission status: Runtime Error

Solution code:
s = input().strip()

flag = 0
ok_list = ['A', 'T', 'C', 'G']

max_len = 0
start, end, i = 0, 0, 0

while i < len(s):
    if s[i] in ok_list:
        l = 0
        while s[i] in ok_list:
            i += 1
            l += 1

        if l > max_len:
            max_len = l

    else:
         i += 1

print(max_len)

Submission status: Runtime Error

Solution code:
s = input().strip()

flag = 0
ok_list = ['A', 'T', 'C', 'G']

max_len = 0
start, end, i = 0, 0, 0

while i < len(s):
    while s[i] not in ok_list:
        i += 1
    start = i

    while s[i] in ok_list:
        i += 1
    end = i

    tmp = s[start:end]
    if len(tmp) > max_len:
        max_len = len(tmp)


print(max_len)

Submission status: Runtime Error

Solution code:
S=set(["A","C","G","T"])
L=list(input())
A=[]
M=0
for i in L :
  if i in S :
    M+=1
  else :
    A.append(M)
    M=0
print(max(A))

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
a = "BDEFHIJKLMNOPQRSUVWXYZ"
cnt = []
for i in range(n):
    for j in range(i,n+1):
    	fr = s[i;j]
    	value = 1
    	for k in a:
    		if k in fr:
    			value = 0
    	if value:
    		cnt.append(len(fr))
    		
print(max(cnt))

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
a = [B,D,E,F,H,I,J,K,L,M,N,O,P,Q,R,S,U,V,W,X,Y,Z]
cnt = []
for i in range(n):
    for j in range(i,n+1):
    	fr = s[i;j]
    	value = 1
    	for k in a:
    		if k in fr:
    			value = 0
    	if value:
    		cnt.append(len(fr))
    		
print(max(cnt))

Submission status: Runtime Error

Solution code:
s = input()
n = len(s)
a = [B,D,E,F,H,I,J,K,L,M,N,O,P,Q,R,S,U,V,W,X,Y,Z]
cnt = []
for i in range(n):
    for j in range(i,n+1):
    	fr = s[i;j]
    	value = 1
    	for k in a:
    		if k in fr:
    			value = 0
    	if value:
    		cnt.append(len(fr))
print(max(cnt))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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] = 'う～えす～ぎさ～ん'
            break


ct = 0
ct_lis = []

for i, x in enumerate(s):
    if (x == 'う～えす～ぎさ～ん'):
        ct += 1
    else:
        ct_lis.append([ct])
        ct = 0

print(max(ct_lis)[0])

Submission status: Runtime Error

Solution code:
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] = 'う～えす～ぎさ～ん'


ct = 0
ct_lis = []

for i, x in enumerate(s):
    if (x == 'う～えす～ぎさ～ん'):
        ct += 1
    else:
        ct_lis.append([ct])
        ct = 0

print(max(ct_lis)[0])

Submission status: Runtime Error

Solution code:
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] = 'う～えす～ぎさ～ん'


ct = 0
ct_lis = []

for i, x in enumerate(s):
    if (x == 'う～えす～ぎさ～ん'):
        ct += 1
    else:
        ct_lis.append([ct])
        ct = 0

print(max(ct_lis))

Submission status: Runtime Error

Solution code:
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)
# print(tmp)
tmp2 = [tmp[i+1]-tmp[i] for i in range(len(tmp)-1)]
print(max(tmp2)-1)

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for a in S:
    
    if a == 'A' or a =='T' or a == 'C' or a =='G':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
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
    else:
        ls.append(count)
        count = 0

print(max(ls))

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in range(len(S)):
    
    if S[i] == 'A' or 'T' or 'C' or'G':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in range(len(S)):
    
    if S[i] in 'ATGC':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in len(S):
    
    if S[i] in 'ATGC':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))

Submission status: Runtime Error

Solution code:
N,Q=map(int,input().split())
S=input()
L=[tuple(map(int, input().split())) for _ in range(Q)]
print("\n".join([str(len(S[nS-1:nE])-len(S[nS-1:nE].replace("AC", "|"))) for nS, nE in L]))

Submission status: Runtime Error

Solution code:
from sys import stdin
S = stdin.readline().rstrip()
list = []
sl = 0
for _ in S:
    if _ in "AGCT":
        sl+=1
    else:
        list.append(sl)
        sl = 0
print(max(list))

Submission status: Runtime Error

Solution code:
# coding: utf-8
from sys import stdin
import math
S = stdin.readline().rstrip()
list = []
sl = 0
for _ in S:
    if _ in "AGCT":
        sl+=1
    else:
        list.append(sl)
        sl = 0
print(max(list))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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
    else:
        cnt.append(c)
        c = 0

print(max(cnt))

Submission status: Runtime Error

Solution code:
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(len(str(max(s))))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import re

s = input()

result = re.findall(r'[ATGC]+', s)

print(len(max(result)))

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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
print(max(s_list))

Submission status: Runtime Error

Solution code:
str = input()
max = 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))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
b=[]
count=0
for i in range(len(s)):
  if s[i] in "ATCG":
    count+=1
  else:
    b.append(count)
    count=0
print(max(b))

Submission status: Runtime Error

Solution code:
s = input()
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))

Submission status: Runtime Error

Solution code:
import re

s = input()
ans = []
while len(s) > 0:
    ans.append(len(re.match("[ATCG]*", s)[0]))
    s = s[1:-1]
print(max(ans))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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:
        counter = ichi_list.append(counter)
        counter = 0

print(max(ichi_list))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:

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

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

Submission status: Runtime Error

Solution code:
S = str(input())
counter = 0
series = []

for i in S:
    if i == 'A' or i == 'T' or i == 'C' or i == 'G':
        counter += 1
    else:
        series.append(counter)
        counter = 0

print(max(series))

Submission status: Runtime Error

Solution code:
s = 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)
        
max(L)

Submission status: Runtime Error

Solution code:
S = str(input())
counter = 0
series = []

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

print(max(series))

Submission status: Runtime Error

Solution code:
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
print(max(count))

Submission status: Runtime Error

Solution code:
s=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))

Submission status: Runtime Error

Solution code:
s = input()
list0 = ['A', 'C', 'G', 'T']
list1 = []
frag = 0
for i in s:
  if i in list0:
    frag += 1
  else:
    if frag != 0:
      list1.append(frag)
    frag = 0
list1.appned(0)
print(max(list1))

Submission status: Runtime Error

Solution code:
s = input()
list0 = ['A', 'C', 'G', 'T']
list1 = []
frag = 0
for i in s:
  if i in list0:
    frag += 1
  else:
    if frag != 0:
      list1.append(frag)
    frag = 0
print(max(list1))

Submission status: Runtime Error

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

print(max(count_list))

Submission status: Runtime Error

Solution code:
ref=input()

count=0
seq=["A","T","G,","C"]
for base in ref:
    if base in ref:
        count +=1
    else count =0

print(count)

Submission status: Runtime Error

Solution code:
import sys

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

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

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

print(longest)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(len(S)):
    j = 0
    while i + j < len(S):
        if S[i + j] in ACGT:
            j += 1
        else:
            ans.append(S[i : i + j])
            break
print(max([len(x) for x in ans]))

Submission status: Runtime Error

Solution code:
s=input()
ans=0
ans_list=[]
n=len(s)


for i in range(0,n):
    if s[i] not in {'A','T','C','G',' '}:
        ans_list.append(ans)
        ans=0
    else:
        ans+=1

#print(ans_list)
if max(ans_list)==0:
    print(0)
else:
    print(max(ans_list))

Submission status: Runtime Error

Solution code:
str_S = raw_input()

list_S = list(str_S)

list_str = []
list_number = []

list_S2 = list_S

for char in list_S:
    number = 0
    list_S2.remove(char)

    if char == 'A' or char == 'C' or char == 'T' or char == 'G':
        number += 1
        for n in list_S2:
            if n == 'A' or n == 'C' or n == 'T' or n == 'G':
                char += n
                number += 1
            else:
                list_str.append(char)
                list_number.append(number)
                break
    else:
        list_number.append(0)


print int(max(list_number))

Submission status: Runtime Error

Solution code:
str_S = raw_input()

list_S = list(str_S)

list_str = []
list_number = []

list_S2 = list_S

for char in list_S:
    number = 0
    list_S2.remove(char)

    if char == 'A' or char == 'C' or char == 'T' or char == 'G':
        number += 1
        for n in list_S2:
            if n == 'A' or n == 'C' or n == 'T' or n == 'G':
                char += n
                number += 1
            else:
                list_str.append(char)
                list_number.append(number)
                break


print int(max(list_number))

Submission status: Runtime Error

Solution code:
str_S = raw_input()

list_S = list(str_S)

list_str = []
list_number = []

for char in list_S:
    number = 0
    if char == 'A' or char == 'C' or char == 'T' or char == 'G':
        index = list_S.index(char) + 1
        number += 1
        for n in list_S[index:]:
            if n == 'A' or n == 'C' or n == 'T' or n == 'G':
                char += n
                number += 1
            else:
                list_str.append(char)
                list_number.append(number)
                break


print int(max(list_number))

Submission status: Runtime Error

Solution code:
S=input()
ACGT=["A","C","G","T"]
m=0
for i in range(len(S)):
  j=0
  while S[i+j] in ACGT:
    j+=1   
  m=max(m,j)
print(m)

Submission status: Runtime Error

Solution code:
import re

s = input()

regex = re.compile('[ACGT]+')

l = 0

for i in range(len(s)):
    r1 = regex.match(s[:i])
    r2 = regex.match(s[i:])
    if r1 and r1[0]:
        l = max(l, len(r1[0]))
    if r2 and r2[0]:
        l = max(l, len(r2[0]))

print(l)

Submission status: Runtime Error

Solution code:
import re

s = input()

regex = re.compile('[ACGT]+')

l = 0

for i in range(len(s)):
    r1 = regex.match(s[:i])
    r2 = regex.match(s[i:])
    if r1:
        l = max(l, len(r1[0]))
    if r2:
        l = max(l, len(r2[0]))

print(l)

Submission status: Runtime Error

Solution code:
import re

s = input()

regex = re.compile('[ACGT]+')

l = 0

for i in range(len(s)):
    r = regex.match(s[i:])
    if r:
        l = max(l, len(r[0]))

print(l)

Submission status: Runtime Error

Solution code:
#-*- coding: utf-8 -*-

#入力
s = raw_input()

l = list(s)

count = 0
cl = []

for x in l:
    if x == "A" or x == "C" or x =="G" or x == "T":
        count += 1
    else:
        cl.append(count)
        count = 0

#print(cl)
print(max(cl))

Submission status: Runtime Error

Solution code:
ans = 0
count = 0


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

Submission status: Runtime Error

Solution code:
import re
print(max(list(map(len,re.findall('[ATGC]+',input(),re.S)))))

Submission status: Runtime Error

Solution code:
S = list(input())

num = 0
num_list = []
for i in S:
    if i == "A" or i == "T" or i == "G" or i == "C":
        num += 1
    else:
        num_list.append(num)
        num = 0
print(max(num_list))

Submission status: Runtime Error

Solution code:
S = list(input())

num = 0
num_list = []
for i in S:
    if i == "A" or i == "T" or i == "G" or i == "C":
        num += 1
    else:
        num_list.append(num)
print(max(num_list))

Submission status: Runtime Error

Solution code:
s=input()
ans=1
ans_list=[]
n=len(s)


for i in range(0,n):
    if s[i] in {'A','T','C','G',' '}:
        if i==n-1:
            ans+=1
        elif s[i+1] in {'A','T','C','G',' '}:
            ans+=1
    else:
        ans_list.append(ans)
        ans=1

print(ans_list)
if max(ans_list)==1:
    print(0)
else:
    print(max(ans_list))

Submission status: Runtime Error

Solution code:
s=input()
ans=1
n=len(s)

for i in range(0,n):
    if s[i] in {'A','T','C','G',''}:
        if i==n:
            ans+=1
        elif s[i+1] in {'A','T','C','G',''}:
            ans+=1

if ans>1:
    print(ans)
else:
    print(0)

Submission status: Runtime Error

Solution code:
s=input()
ans=0
n=len(s)

for i in range(0,n):
    if s[i] in {'A','T','C','G',''}:
        if s[i+1] in {'A','T','C','G',''}:
            ans+=1

print(ans)

Submission status: Runtime Error

Solution code:
a=''.join([i if i in ['A', 'C', 'G', 'T'] else ' ' for i in input()])
print(max(len, a.split())

Submission status: Runtime Error

Solution code:
S = input()

ans = list()
ans_tmp = list()

x = {'A', 'G', 'C', 'T'}

for s in S:
  if s in x:
    ans_tmp.append(s)
  else:
    if len(ane_tmp) > len(ans):
      ans = ans_tmp
      ans_tmp = list()

print(len(ans))

Submission status: Runtime Error

Solution code:
S = input()

base_list = ["A", "T", "G", "C"]
seq_list = []
seq = ""
for s in S:
  if s in base_list:
    seq += s
  else:
    seq_list.append(seq)
    seq = ""
seq_len_list = [len(seq) for seq in seq_list]
print(max(seq_len_list))

Submission status: Runtime Error

Solution code:
strings = input()
str_list = ["A","C","G","T"]

tmp_cnt = 0
cnts = []

for string in strings:
  if string in str_list:
    tmp_cnt += 1
  else:
    cnts.append(tmp_cnt)
    tmp_cnt = 0
print(max(cnts))

Submission status: Runtime Error

Solution code:
S=input()
list = [-1]
list2 = []

for i in range(len(S)):
    if S[i] != 'A' and S[i] != 'T' and S[i] != 'G' and S[i] != 'C':
        list.append(i)
i=0
while i<len(list)-1:
    list2.append(list[i+1]-list[i]-1)
    i += 1

for i in range(len(list2)):
    for j in range(i,len(list2)):
        if list2[i]<list2[j]:
            temp = list2[i]
            list2[i] = list2[j]
            list2[j] = temp

print(list2[0])

Submission status: Runtime Error

Solution code:
import re

S=input()
pat = r'[ATCG]+'
parts = re.findall(pat,S)
print 0 if len(parts)==0 else max([len(part) for part in parts])

Submission status: Runtime Error

Solution code:
import re

S=input()
pat = r'[ATCG]+'
parts = re.findall(pat,S)
print(max([len(part) for part in parts]))

Submission status: Runtime Error

Solution code:
x = input()
ans = []
def countOtherThanATCG(x):
    guys = ['A','T','C','G']
    s = list(x)
    for i in guys:
        try:
            s = list(filter(lambda a: a != i, s))
        except:
            pass
    return s

for i in range(len(x)):
    for t in range(len(x)):
        if t == 0:
            st = x[i:]
            res = countOtherThanATCG(st)
            if not res:
                ans.append(n)
        else:    
            st = x[i:-t]
            n = len(st)
            res = countOtherThanATCG(st)
            if not res:
                ans.append(n)
 
print(max(ans))

Submission status: Runtime Error

Solution code:
x = input()
ans = []
def countOtherThanATCG(x):
    guys = ['A','T','C','G']
    s = list(x)
    for i in guys:
        try:
            s.remove(i)
        except:
            pass
    return s

for i in range(len(x)):
    for t in range(len(x)):
        if t == 0:
            st = x[i:]
            n = len(st)
            res = countOtherThanATCG(st)
            if not res:
                ans.append(n)
        else:    
            st = x[i:-t]
            n = len(st)
            res = countOtherThanATCG(st)
            if not res:
                ans.append(n)
print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

ACGT = ["A","C","T","G"]
ctr = 0
ctrs = []
for c in S:
  if c in ACGT:
    ctr += 1
  else:
    ctrs.append(ctr)
    ctr = 0

print(max(ctrs))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Apr  5 14:11:52 2019

@author: adachi-lab
"""

input_code = str(input())
L1 = len(input_code)

list_3 = []
for w in range(L1):
    list_3.append(w)


x = 0
for i in range(L1):
    code = input_code[i]
    if code == 'A' or code == 'C' or code == 'G' or code == 'T':
        list_3.remove(x)
    
    x+=1

L3 = len(list_3)
list_4 = []

if list_3[0] == 0:
    for q in range(L3-1):
        list_4.append(list_3[q+1]-list_3[q]-1)
    list_4.append(L1-list_3[L3-1]-1)
    
    
else:
    list_3.insert(0,0)
    list_4.append(list_3[1])
    for q in range(L3):
        list_4.append(list_3[q+1]-list_3[q]-1)
    list_4.append(L1-list_3[L3]-1)
    list_4.pop(1)
    
    


print(max(list_4))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Apr  5 14:11:52 2019

@author: adachi-lab
"""

input_code = str(input('入力;'))
L1 = len(input_code)

list_3 = []
for w in range(L1):
    list_3.append(w)


x = 0
for i in range(L1):
    code = input_code[i]
    if code == 'A' or code == 'C' or code == 'G' or code == 'T':
        list_3.remove(x)
    
    x+=1

L3 = len(list_3)
list_4 = []

if list_3[0] == 0:
    for q in range(L3-1):
        list_4.append(list_3[q+1]-list_3[q]-1)
    list_4.append(L1-list_3[L3-1]-1)
    print(list_4)
    
else:
    list_3.insert(0,0)
    list_4.append(list_3[1])
    for q in range(L3):
        list_4.append(list_3[q+1]-list_3[q]-1)
    list_4.append(L1-list_3[L3]-1)
    list_4.pop(1)
    print(list_4)
    


print(max(list_4))

Submission status: Runtime Error

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

for char in a: //入力文字列を１文字ずつ巡回
  for char2 in b: //ATGCを1文字ずつ巡回
    if char == char2:　//合致すればカウント増やす
      count = count + 1 
      break
      
    if char2 == "C" && count != 0
      if maxcount < count:
      	maxcount = count
      count = 0
      
print(maxcount)

Submission status: Runtime Error

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

for char in a: //入力文字列を１文字ずつ巡回
  for char2 in b: //ATGCを1文字ずつ巡回
    if char == char2:　//合致すればカウント増やす
      count = count + 1 
      break
      
    if char2 == "C" && count != 0
      count = 0