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()
cnt = 0
maxcnt = 0
for s in S:
    if s in 'ATGC':
        cnt += 1
    else:
        cnt = 0
    maxcnt = max(maxcnt, cnt)

print(maxcnt)

Solution (Python):
S = str(input())
ACGT = ['A','C','G','T']
L = [0]
for i in range(len(S)):
    if S[i] in ACGT:
        cnt = 0
        for j in range(i, len(S)):
            if S[j] in ACGT:
                cnt += 1
            else:
                break
        L.append(cnt)
print(max(L))

Solution (Python):
s=str(input())
longest_len = 0
temp_len = 0

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

Solution (Python):
sentence = input()
maximum = 0
num_tmp = 0
for i in range(len(sentence)):
  if sentence[i] in ['A','G','C','T']:
    num_tmp += 1
    if num_tmp == maximum + 1:
      maximum += 1
  else:
    num_tmp = 0
print(maximum)

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

Solution (Python):
import re

print(len(max(re.split('[^ACGT]',input()), key=len)))

Solution (Python):
string=input()
acgt=["A","C","G","T"]
max=0
num=0
for i in range(len(string)):
    if string[i] in acgt:
        num+=1
        if max<num:
            max=num
    else:
        num=0
print(max)

Solution (Python):
def check(c):
    if c == 'A' or c == 'C' or c == 'G' or c == 'T':
        return True
    return False
s = input()
dem  = 0
demmax = 0
for i in range(len(s)):
    if check(s[i]):
        dem+=1
        if dem > demmax: demmax = dem
    else: dem = 0
print (demmax)

Solution (Python):
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
        if i + j == len(S):
            ans.append(S[i : len(S)])
    
    print(max([len(x) for x in ans]))

Solution (Python):
s = input()

ans = 0
for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        flag = True
        for t in s[i:j]:
            if t != 'A' and t != 'C' and t != 'G' and t != 'T':
                flag = False
                break
        if flag:
            ans = max(ans, len(s[i:j]))

print(ans)

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

count = 0
max = 0

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

print(max)

Solution (Python):
S = input()
smax = 0
for i in range(len(S)):
    for j in range(i, len(S)):
        contFlg = True
        for k in S[i:j + 1]:
            if 'ACGT'.count(k) != 1:
                contFlg = False
                break
        if contFlg:
            smax = max(smax, len(S[i:j + 1]))

print(smax)

Solution (Python):
input=input()
count=0
max=0
for c in input:
    if c is 'A' or c is 'C' or c is 'G' or c is 'T':
        count+=1
    else:
        if max < count:
            max = count
        count=0
if max < count:
    max = count
print (max)

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

def is_acgt(string):
    a_count = string.count("A")
    c_count = string.count("C")
    g_count = string.count("G")
    t_count = string.count("T")
    acgt_count = a_count + c_count + g_count + t_count
    string_count = len(string)
    if acgt_count == string_count:
        return True
    else:
        return False

for i in range(0, 11):
    

    
    for j in range(i + 1, 11):
        
        
        result = is_acgt(S[i:j])
        if result and len(S[i:j]) > longest_acgt:
            longest_acgt = len(S[i:j])
            pass
print(longest_acgt)

Solution (Python):
import re
s = input()
ssp = re.split('[BDEFHIJKLMNOPQRSUVWXYZ]',s)
maxlen = 0
for i in ssp:
	if maxlen < len(i):
		maxlen = len(i)
print(maxlen)

Solution (Python):
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
        if i == n-1:
           ans_list.append(ans) 
 


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

Solution (Python):
T = str(input())
counter = 0

for index1, rep1 in enumerate(T):
    if rep1 in "ATGC":
        temp_counter =0
        
        for rep2 in T[index1:]:
            if rep2 in "ATGC":
                temp_counter+=1
            else:
                break

        if temp_counter > counter:
            counter = temp_counter

print(counter)

Solution (Python):

str_S = raw_input()

list_S = list(str_S)
list = list(str_S)

list_number = []

while list != []:
    number = 0
    for char in list:
        if char == 'A' or char == 'C' or char == 'G' or char == 'T':
            number += 1
        else:
            break
    list_number.append(number)

    for n in range(number + 1):
        if list != []:
            list.pop(0)

print max(list_number)

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

longest = 0
current = 0
for c in s:
	if c in set("ATCG"):
		current += 1
	else:
		longest = max([current, longest])
		current = 0

print(max([current, longest]))

Solution (Python):
hoge=input()
ans=0
for i in range(len(hoge)):
  for j in range(len(hoge)):
    huga=hoge[i:1+j]
    if(len(huga)==huga.count("A")+huga.count("C")+huga.count("T")+huga.count("G")):
      ans=max(ans,len(huga))

print(ans)

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

Solution (Python):
S = input()
maxlength = 0
length = 0
for i in S:
  if i in 'ATGC':
    length += 1
  else:
    length =0
  maxlength = max(maxlength, length)
print (maxlength)

Solution (Python):
acgt = 'ACGT'
hiscore, score = 0, 0
for char in input():
  if char in acgt:
    score += 1
  else:
    hiscore = max(hiscore, score)
    score = 0

hiscore = max(hiscore, score)
print(hiscore)

Solution (Python):
s = input()

max_count = 0
count = 0

for i in s:
    if i not in ['A', 'C', 'G', 'T']:
        count = 0
        continue
    count += 1
    max_count = max(max_count, count)

print(max_count)

Solution (Python):
S = input()
length = 0
maxlen = 0
for c in S:
    if c in "ACGT":
        length += 1
    else:
        length = 0
    maxlen = max(maxlen, length)
print(maxlen)

Solution (Python):
s = input()


def length(s, i, j):
    for c in s[i:j + 1]:
        if c not in 'ACGT':
            return 0
    return len(s[i:j + 1])


def find(s):
    candidate = 0
    for i in range(len(s)):
        for j in range(len(s)):
            candidate = max(candidate, length(s, i, j))

    return candidate


print(find(s))

Solution (Python):



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
cl.append(count)


print(max(cl))

Solution (Python):
s = input()
max_count = 0
count = 0
acgt = ['A', 'C', 'G', 'T']
for i, c in enumerate(s) :
    if c in acgt :
        count += 1
        if i == len(s) - 1 and max_count < count :
            max_count = count
    else :
        if count != 0 and max_count < count :
            max_count = count
        count = 0
print(max_count)

Solution (Python):

import sys


def solve(S: str):
    res = 0
    ACGT = {"A","C","G","T"}
    for i in range(len(S)):
        sub = 0
        for l in range(len(S) - i):
            if S[i + l] in ACGT:
                sub+=1
            else:
                break
        res = max(res,sub)
    print(res)
    return



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

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

inatcg = False
longest = 0
cur = 0
for c in s:
    if c in {'A', 'T', 'C', 'G'}:
        inatcg = True
        cur += 1
    else:
        if inatcg:
            longest = max(longest, cur)
            cur = 0
            inatcg = False

print(max(cur,longest))

Solution (Python):
S = input()

str_map = []
for c in S :
    if (c in ['A','C','G','T']) :
        str_map.append('o')
    else :
        str_map.append('x')

print(len(max(''.join(str_map).split('x'))))

Solution (Python):
s = input()
import re
sarr = re.split('[^ACTG]', s)
sarr = sorted(sarr, key=lambda x: len(x))
print(len(sarr[-1]))

Solution (Python):
st = str(input())

ans = 0
tmp = 0
for i in range(len(st)):
    if st[i] == 'A' or st[i] == 'T' or st[i] == 'G' or st[i] == 'C':
        tmp += 1
    else:
        if ans < tmp:
            ans = tmp
        tmp = 0

if ans < tmp:
    ans = tmp
print(ans)

Solution (Python):
S = input()

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

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

Solution (Python):
S = str(input()) + 'X'
l = len(S)
x = 0
list = []
for i in range(l):
	if S[i] == 'A' or S[i] == 'T' or S[i] == 'G' or S[i] == 'C' :
		x = x + 1
	else:
		list.append(x)
		x = 0
print(max(list))

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

for i in range(len(s)):
    for j in range(len(s) - i):
        t = s[i:-j] if j != 0 else s[i:]
        c = 0
        for k in t:
            if k == 'A' or k == 'T' or k == 'C' or k == 'G':
                c += 1
        if c == len(t):
            ans = max(ans, len(s) - i - j)
            
print(ans)

Solution (Python):
import re
result = re.findall('[ATCG]+',input(),re.S)
if len(result)>0:
  print(max(list(map(len,result))))
else:
  print(0)

Solution (Python):
S = input()
S1 = len(S)
S3 = 0
S4 = 0
while S1 != 0:
    S2 = S[0:1]
    S1 = S1 - 1
    S = S[1:]
    if S2 == "A" or S2 == "C" or S2 == "G" or S2 == "T":
        S3 = S3 + 1
    else:
        if S3 > S4:
            S4 = S3
            S3 = 0
if S3 > S4:
    S4 = S3
    S3 = 0
print(str(S4))

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

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

Solution (Python):

s = ''.join([i if i in 'ACGT' else '-' for i in input()])
s = [[i, len(i)] for i in s.split('-')]

_, maxi = max(s, key=lambda x:x[1])
print(maxi)

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

Solution (Python):
import sys

S = input()
acgt = 'ACGT'
ans = 0

for i in range(len(S)):
    tmp = 0
    for j in range(i, len(S)):
        if S[j] in acgt:
            tmp += 1
        else:
            break
    if tmp > ans:
        ans = tmp

print(ans)

Solution (Python):
S = input()
number = 0
answer = 0

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

print(answer)

Solution (Python):


a = input()

l = ["A","T","G","C"]
count  = 0
max = 0
t = 0
for i in range(len(a)):
    for j in range(i,len(a)):
        if(a[j] not in l):
            count = 0
            break;
        else:
            count += 1
            if(max < count):
                max = count
    count = 0
print(max)

Solution (Python):


import re

def main():
    print(max([len(x) for x in re.findall(r'[ACGT]*', str(input()))]))

if __name__ == "__main__":
    main()

Solution (Python):
x = input()

best = 0
hoge = 0
for i in x:
  if i == 'A' or i == "T" or i == "C" or i == 'G':
    hoge += 1
    if hoge > best:
      best = hoge
  else:
    hoge = 0
print(best)

Solution (Python):
import re


s = input()
f = re.findall(r'([ACGT]*)', s)
ans = 0
for i in f:
    if len(i) > ans:
        ans = len(i)
print(ans)

Solution (Python):
genom=input()
maxstr=0
bush=0

for i in range(len(genom)):
    if genom[i]=="A" or genom[i]=="G" or genom[i]=="T" or genom[i]=="C":
        bush = bush+1
        maxstr=max(bush, maxstr)
    else:
        bush=0

print(maxstr)

Solution (Python):
S = input()

out = [[]]
for s in S:
    if s in ['A', 'T', 'G', 'C']:
        out[-1].append(s)
    else:
        out.append([])

print(len(max(out, key=len)))

Solution (Python):
s=input()
ans=""
tmp=""
for i in s:
    if i not in "ATCG":
        if len(ans)<=len(tmp):
            ans=tmp
        tmp=""
        continue
    tmp+=i
if len(tmp)>=len(ans):
    ans=tmp
print(len(ans))

Solution (Python):
S = input()
A = S
for i in range(len(S)):
  if (S[i] in ["A","T","C","G"]) != True:
    A = A.replace(S[i],"0")
  else:
    A = A.replace(S[i],"1")
print(max(A.split("0")).count("1"))

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

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

Solution (Python):
a = list(input())
L = ["A", "T", "G", "C"]
m = 0
c = 0
for w in a:
    if w in L:
        c += 1
    else:
        c = 0
    m = max(m, c)
print(m)

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

Solution (Python):
S = input()

ans = 0
ans_tmp = 0

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

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

print(ans)

Solution (Python):
import numpy as np
s = list(raw_input())
s = [1 if (i == 'A') | (i == 'C') | (i == 'G') | (i == 'T') else 0 for i in s]
s = np.array(s)
count = np.zeros(len(s), dtype=np.int)

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

for i in range(1,len(s)):
	if (s[i-1] == 0) & (s[i] == 1):
		count[i] = 1
		for j in range(i+1,len(s)):
			if s[j] == 1:
				count[i] += 1
			else:
				break

print max(count)

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
l = ["A","T","C","G"]
s = input()
m = 0
a = 0
for t in list(s):
  if t in l:
    a += 1
  else:
    m = max(m,a)
    a = 0
print(max(m,a))

Solution (Python):
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_list.append(seq)
seq_len_list = [len(seq) for seq in seq_list]
print(max(seq_len_list))

Solution (Python):
import re
s = input()
agct_substr = re.findall(r'[AGCT]+', s)
print(len(sorted(agct_substr, key=lambda x: len(x), reverse=True)[0]) if len(agct_substr) != 0 else 0)

Solution (Python):
s = input()
temp="ATCG"

max_cnt = 0
cnt = 0
for _s in s:
    if _s in temp:
        cnt+=1
        if max_cnt < cnt:
            max_cnt=cnt
    else:
        cnt=0

print(max_cnt)

Solution (Python):
base_dict = {"A": "T", "T": "A", "G": "C", "C": "G"}

S = input()

max_count = 0
current_count = 0

i = 0
loop = 0
while i < len(S):
    if S[i] in base_dict:
        current_count += 1
        i += 1
    else:
        if max_count < current_count:
            max_count = current_count
        current_count = 0
        loop += 1
        i = loop

if max_count < current_count:
    max_count = current_count

print(max_count)

Solution (Python):
longest=0
l=['A','T','G','C']
s=input()
for i in range(len(s)):
  if s[i] in l:
    start=i
    nowlen=0
    while(s[start] in l):
      if start==len(s)-1:
        nowlen+=1
        break
      else:
        start+=1
        nowlen+=1
    if nowlen>longest:
      longest=nowlen
print(longest)

Solution (Python):
S=input()
n=len(S)
i=0
count=0
maxcount=0
while(n>0):
    if(S[i]=='A'or S[i]=='T' or S[i]=='G' or S[i]=='C'):
        count=count+1
        if(maxcount<count):
            maxcount=count
    else:
        if(maxcount<count):
            maxcount=count
        count=0
    n=n-1
    i=i+1
print(maxcount)

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

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

list.append(len(S))

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

Solution (Python):
import re

i = input()
r = 0
match_list = re.findall(r'[ATCG]+', i)

if match_list:
    r = max([len(x) for x in match_list])

print(r)

Solution (Python):
input = raw_input()

score = 0
scoped = 0

for i in range(len(input)):
    if input[i] in ['A', 'T', 'G', 'C']:
        scoped += 1
        if score < scoped:
            score = scoped
    else:
        scoped = 0

print score

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

success_strings = ["A","G","T","C"]
"""
1文字目から取得していって、一致するものがあればカウントしていく
一致しなくなったらカウントをやめて、次の文字から探索する
"""

cnt = 0
for i in range(0, len(strings)):
    temp_cnt = 0

    for n in range(i, len(strings)):
        if strings[n] in success_strings:
            temp_cnt += 1
        else:
            break

        if temp_cnt > cnt:
            cnt = temp_cnt

print(cnt)

Solution (Python):
S = input()

count = [0 for i in range(len(S))]

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

idx = 0
for i in S:
    if i in atgc:
        count[idx] = 1
    idx += 1

list_ct = []
ct = 0
for i in count:
    if i == 1:
        ct += 1
    else:
        if ct > 0:
            list_ct.append(ct)
            ct = 0

if ct:
    list_ct.append(ct)

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

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

Solution (Python):
import re

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

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

print(ans)

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

start = False
i = 0
count = 0
max = 0
while i < len(S) and (len(S) - max > i or start):
    if start:
        if S[i] not in ["A", "C", "G", "T"]:
            start = False
            count = 0
    else:
        if S[i] in ["A", "C", "G", "T"]:
            start = True

    if start:
        count += 1
        if count > max:
            max = count
    i += 1
print(max)

Solution (Python):
S = input()
list = ["A","C","T","G"]
n = len(S)
box = []

for i in range(n):
    if S[i] in list:
        box.append(1)
    else:
        box.append(0)
        
box.append(0)

cnt = 0
ans = [0]

for i in range(n):
    if box[i] == 1:
        cnt += 1
        if box[i+1] == 0:
            max = cnt
            ans.append(max)
            cnt = 0
X = sorted(ans)
print(X[-1])

Solution (Python):
L = list(input())
count, max_ = 0, 0
for i in L:
  if i == 'A' or i == 'T' or i == 'C' or i == 'G':
    count += 1
  else:
    if count > max_:
      max_ = count
    count = 0
if count > max_:
  max_ = count
print(max_)

Solution (Python):
S = input()

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

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
max_count = max(max_count,count)
print(max_count)

Solution (Python):
import sys

s = sys.stdin.readline()

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

Solution (Python):
import sys

s = sys.stdin.readline()

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

Solution (Python):
s = input()
acgt = 'ACGT'

count = 0
max = 0
for char in s:
  if char in acgt:
    count += 1
    if count > max:
      max = count
  else:
    count = 0
print(max)

Solution (Python):
S=input()+"a"
buf=0
count=0
for c in S:
  if c=="A" or c=="T"or c=="G"or c=="C":
    count+=1
  elif buf<count:
    buf=count
    count=0
print(buf)

Solution (Python):
ACGT=["A","C","G","T"]
s=list(input())
s.append("0")
s.append(" ")
i=0
ans=[0]
length=0
while s[i] != " ":
  if s[i] in ACGT:
    length += 1
    i += 1
  else:
    ans.append(int(length))
    length = 0
    i += 1

print(max(ans))

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

print(max(d))

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

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

ans = [0]
n = 0

for x in S:
    if x in {'A','T','C','G'}:
        n += 1
    else:
        ans.append(n)
        n = 0

ans.append(n)
        
print(max(ans))

Solution (Python):
S = input()
L = len(S)
ACGT = ["A","C","T","G"]
ctr = 0
ctrs = [0]
for l in range(L):
  if S[l] in ACGT:
    ctr += 1
    if l==L-1:
      ctrs.append(ctr)
  else:
    ctrs.append(ctr)
    ctr = 0
 
print(max(ctrs))

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

ans=0
for i in range(len(S)):
  tmp=i
  while S[tmp] in C:
    tmp+=1
    if tmp>=len(S):
      break
  ans=max(ans,tmp-i)
print(ans)

Solution (Python):
T = list(map(str,input()))

count = 0
flag1 = 0
list_count = []
for i in T:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        flag1 = 1
        count = count +1
    elif flag1 ==1:
        list_count.append(count)
        flag = 0
        count = 0
list_count.append(count)
print(max(list_count))

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

      

      

print(ans)

Solution (Python):
S = list(input())
max_len = 0
for i in range(len(S)):
    for j in range(i, len(S)):
        bubun = S[i:j+1]
        is_acgt = [s in ("T","A","G","C") for s in bubun]
        if all(is_acgt) and len(bubun)>max_len:
            max_len = len(bubun)
print(max_len)

Solution (Python):
s = input()

pattern = "ACGT"

max_cnt = 0
cnt = 0
for part in s:
    if part in pattern:
        cnt += 1
        max_cnt = max(cnt, max_cnt)
    else:
        cnt = 0

print(max_cnt)

Solution (Python):



def main():
    S = input()
    i = 0
    max_length = 0
    for c in S:
        if c in ['A', 'T', 'G', 'C']:
            i += 1
        else:
            if max_length < i:
                max_length = i
            i = 0
    if max_length < i:
        max_length = i
    print(max_length)



if __name__ == "__main__":
    main()

Solution (Python):
S = input()

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

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

Solution (Python):
import re
print(len(max(re.findall('[ACGT]*',input()), key=len)))

Solution (Python):

"""
Created on Fri Apr  5 16:48:09 2019

@author: adachi-lab
"""

input_code = input()
L1 = len(input_code)
list_3 = []
list_4 = []
list_5 = []

for w in range(L1):
    list_3.append(0)
    list_4.append(0)


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

for n,m in zip(list_3,list_4):
    
    if n == m:
        c = 0
        list_5.append(c)
        
    else:
        c += 1
        list_5.append(c)
        
print(max(list_5))

Solution (Python):


s = input()
ansf = 0
anss = 0
for i in s:
    if i== "A" or i =="C" or i =="G" or i == "T":
        ansf += 1
    else:
        ansf = 0
    anss = max(anss,ansf)

print(anss)

Solution (Python):
ACGT = input()

result = 0
tmp = 0
for c in ACGT:
  if c in 'ACGT':
    tmp += 1
  else:
    tmp = 0
  result = max(result, tmp)

print(result)

Solution (Python):
s = input()

maxx = 0
count = 0
data = ["A","C","T","G"]
for i in range(len(s)): 
    for j in range(i,len(s)): 
        if s[j] in data:
          count += 1
        else:
          break
    if maxx < count :
        maxx = count
    count = 0

print(maxx)

Solution (Python):
S = input()
L = 0
max_L = 0
 
for i in range(len(S)):
  s = S[i]
  TF = any(['A' in s, 'C' in s, 'G' in s, 'T' in s])
  if TF:
    L += 1
    if L >= max_L:
        max_L = L
  elif L >= max_L:
    max_L = L
    L = 0

print(max_L)

Solution (Python):
import re 
S = input()
 
p = re.compile('[ATCG]+')
f = p.finditer(S)
 
candidate = [i.span()[1]- i.span()[0] for i in f]
if candidate == [] :
    print(0)
else :
    print(max(candidate))

Solution (Python):
s = ["A","T","C","G"]
a = str(input())
max = 0
tmp = 0
for c in a:
  if c in s:
    tmp = tmp + 1
    if tmp > max:
      max = tmp
  else:
    tmp = 0
print("{}".format(max))

Solution (Python):
import re
s = input()
ms = re.findall('[ACGT]*', s)
ma = 0
for m in ms:
  ma = max(ma, len(m))
print(ma)

Solution (Python):
import re
base_pattern = re.compile(r"[A|T|C|G]*")
base_list = base_pattern.findall(input())
print(max(list(map(len,base_list))))

Solution (Python):
def main():
    S = list(input())
    count = 0
    counts = []
    for i in S:
        if i in ['A', 'T', 'C', 'G']:
            count += 1
        else:
            counts.append(count)
            count = 0
    counts.append(count)
    print(max(counts))
main()

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

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

c=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' :
    c+=1
    if c>max :
      max=c
  else :
    c=0
  
print(max)

Solution (Python):
S = input() + 'E'
for w in list('ACGT'):
    S = S.replace(w, ' ')
count = 0
max_count = 0
for w in S:
    if w == ' ':
        count += 1
    elif count > max_count:
        max_count = count
        count = 0
print(max_count)

Solution (Python):
S = input()
acgt = ['A','C','G','T']
for base in acgt:
    S = S.replace(base, ' ')
S += 'E'
maxlen = 0;
count = 0;
for w in S:
    if w == ' ':
        count += 1
    else:
        if count > maxlen:
            maxlen = count
        count = 0
print(maxlen)

Solution (Python):
S = input()
count = 0
num = 0


for i in S:
    if i=="A" or i=="C" or i=="G" or i=="T":
         count = count + 1
         if count >= num:
             num = count
    else:
        count = 0

print(num)

Solution (Python):
S = list(input())
N = len(S)
H = list('ATGC')
m = 0
ans = 0
for i in range(N):
    if S[i] in H:
        m += 1
        if ans < m:
            ans = m
    else:
        m = 0
print(ans)

Solution (Python):
S = input()
N = len(S)
max_n = 0
for n in range(N):
    for m in range(n, N):
        s = S[n:m+1]
        if all("ATCG".count(ss) == 1 for ss in s):
            max_n = max(max_n, len(s))
print(max_n)

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

Solution (Python):
S = input()
def ACGT(S):
    for d in S:
        if not d in "AGCT":
            return False
    return True
def solve(S):
    res = 0
    for i in range(len(S)):
        for j in range(i,len(S)+1):     
            if (ACGT(S[i:j])):
                res = max(j-i,res)
    return res
print(solve(S))

Solution (Python):

"""
Created on Thu Apr  4 14:15:23 2019

@author: fumito
"""

S = str(input())
S_list = [i for i in S]
list1 = []
for i in S_list:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        list1.append(0)
    else:
        list1.append(1)

list2 = []
count = 0    
for j,k in enumerate(list1): 
    if k == 0:
        count += 1
    if k == 1 or j == len(list1)-1:
        list2.append(count)
        count = 0
print(max(list2))

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


count = 0
count_max = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        count += 1
    else:
        if count_max < count:
            count_max = count
            count = 0

if count_max < count:
    count_max = count

print(count_max)

Solution (Python):
cnt=0
m_cnt=0
for c in input():
    if c in ['A','C','G','T']:
        cnt+=1
        if cnt > m_cnt:
            m_cnt=cnt
    else:
        cnt=0
print(m_cnt)

Solution (Python):
l=['A','C','G','T']
cnt=0
max_cnt=0
for c in input():
    if (c in l):
        cnt+=1
        if (cnt > max_cnt):
            max_cnt=cnt
    else:
        cnt=0
print(max_cnt)

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

Solution (Python):
str = input()
maxans = []
ans = []

for j in range(0,len(str)):
  for i in range(j,len(str)):
    if str[i] == 'A' or str[i] == 'C' or str[i] == 'G' or str[i] == 'T':
      ans.append(str[i])
    else:
      break
  if len(ans) >= len(maxans):
    maxans = ans
  ans = []
      
print(len(maxans))