peterverebics/CodeNet_Python_118 huggingface dataset:
S = input()

l = len(S)

max_cnt = 0
for i in range(l):
    for j in range(i, l):
        max_cnt = max(sum([1 if s == "A" or s == "C" or s == "G" or s == "T" else 0 for s in S[i : j + 1]]), max_cnt)
print(max_cnt)
s = input().strip()
ans = 0
tmp = 0
for _, x in enumerate(s):
    if x == "A" or x == "C" or x == "G" or x == "T":
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0
print(ans)
S = input()
ans = 0
for i in range(len(S)):
    tmp = 0
    for j in range(len(S)):
        if 'ACGT'.count(S[j]) == 1:
            tmp += 1
        else:
            ans = max(ans, tmp)
            tmp = 0

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

if __name__ == '__main__':
    main()
s = list(input())
ans = 0
tmp = []

for i in range(len(s)):
    for j in range(1,len(s)-i):
        tmp = s[i:(-1)*j]

#        print(tmp)
#        print(tmp.count("A"))
#        print(tmp.count("C"))
#        print(tmp.count("G"))
#        print(tmp.count("T"))

        if tmp.count("A") + tmp.count("C") + tmp.count("G") + tmp.count("T") == len(tmp):
            if len(tmp) >= ans:
                ans = len(tmp)

print(ans)
S=input()

flag =0
ans =0

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

print(ans)
if __name__ =='__main__':
    s = input()
    ans = 0
    seq = 0
    for c in s:
        if c=='A' or c=='T' or c=='G' or c=='C':
            seq+=1
        else:
            ans = max(ans,seq)
    ans = max(ans,seq)
    print(ans)
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(1,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j])-P == set():
        count = max(count,j-i)
        
print(count)
def abc122_b():
    s = input()
    acgt = ['A', 'C', 'G', 'T']

    check = [1 if s[i] in acgt else 0 for i in range(len(s))]

    result = 0
    for i in range(len(check)):
        for j in range(len(check)):
            if check[i:j].count(0) == 0:
                if result < len(check[i:j]):
                    result = len(check[i:j])

    print(result)

if __name__ == '__main__':
    abc122_b()
S = input()
ans = 0
for i in range(len(S)):
    for j in range(i,len(S)):
        print(S[i:j+1])
        flag = True
        for k in S[i:j+1]:
            if not (k=='A' or k=='C' or k=='G' or k=='T'):
                flag = False
                break
        if flag:
            ans = max(ans, len(S[i:j+1]))
print(ans)
S = list(input())
ans = 0
cnt = 0
for s in S:
    if s in ['A','C','G','T']:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0
print(ans)
a = 'ATCG'
s = input()
ans = 0
cnt = 0
for i in range(len(s)):
    if s[i] in a:
        cnt += 1
    else :
        if cnt > ans:
            ans= cnt
        cnt = 0
print(ans)
S = input()

ans = 0
cnt = 0
for i in S:
    if i in ("A","C","G","T"):
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0
print(ans)
s = input()
sl = len(s)
l = [0]*sl
c = 0
ans = 0

for i in range(sl):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        l[i] = 1

for i in range(sl):
    if l[i] == 1:
        c += 1
    else:
        ans = max(ans, c)
        c = 0

print(ans)
s = input()
point = 0

for i in s:
    if i in "ACGT":
        point += 1

print(point)
max_len = 0
tmp = 0

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

for i in range(len(S)):
    if S[i] in atcg:
        tmp += 1
    else:
        max_len = max(max_len, tmp)
        tmp = 0

print(max_len)
s = input()

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

result = ""
result_old = ""

#現在の文字列の長さ
#1個前の文字列の長さ

for i in range(int(len(s))):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        result = result +s[i] 
    else:
        if int(len(result_old)) < int(len(result)):
            result_old = result
        else:
            result = [None for _ in range(int(len(result)))]
            result = ""
print(len(result_old))
ans=0
for i in list(input()):
    if i in {"A","G","C","T"}:ans+=1
print(ans)
S = input()

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

print(ans)
s = list(input())
ans = 0
cnt = 0
l = ['A', 'C', 'G', 'T']
for i in range(len(s)):
    if s[i] in l:
        cnt += 1
    else:
        ans = max(cnt, ans)
        cnt = 0
print(ans)
s = input()
l = list(s)
count = 0
ans = 0
for i in range(len(l)):
    if l[i] == "A" or l[i] == "T" or l[i] == "G" or l[i] == "C":
        count += 1
        continue
    ans = max(ans,count)
    count = 0
print(ans)
S = input()

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

count_list = [0]
count = 0
max_count = 0
for s in S:
    if s in ACGT:
        count += 1
    else:
        count_list.append(count)
        # max_count = max(max_count, count)
        count = 0
print(max(count_list))
s = input()

cnt = 0
ans = 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:
        ans = max(ans, cnt)
        cnt = 0

print(ans)
s = input()

l,r = 0,0
ma = 0
for l in range(len(s)):
    if(s[l] not in ['A','C','G','T']):continue
    for r in range(l,len(s)):
        if(s[r] not in ['A','C','G','T']):break
    ma = max(ma,max(1,len(s[l:r])))
print(ma)
s=input()
count,ans=0,0
for i in range(len(s)):
  if s[i] in 'ACGT':
    count+=1
  else:
    ans=max(ans,count)
    count=0
print(ans)
ACGT = ['A', 'C', 'G', 'T']
def ok(S):
    for c in S:
        if c not in ACGT:
            return False
    return True
def main():
    S = input()
    res = ''
    for i in range(len(S)-1):
        for j in range(1, len(S)):
            ps = S[i:j]
            if ok(ps) and len(ps) > len(res):
                res = ps

    print(len(res))
    

main()
S=input()
l=['A','C','G','T']
cnt=0
for s in S:
    if s in l: cnt+=1
print(cnt)
s = input()
n = len(s)
ans = -1e9
for i in range(n):
    for j in range(i, n):
        ok = True
        for k in range(i, j + 1):
            if s[k] not in ['A', 'T', 'G', 'C']:
                ok = False
        if ok:
            ans = max(ans, j - i + 1)
print(ans)
s=list(input())
n=len(s)
ans=[]
for i in range(n-1):
  for j in range(i+1,n+1):
    part=set(s[i:j])
    flag=True
    for p in part:
      if p not in list('ATGC'):
        flag=False
        break
    if flag==True:
      ans.append(len(s[i:j]))
#print(ans)
if ans:
  print(max(ans))
else:
  print(0)
s = list(input())
a = ""
ans = 0
for c in s:
    if c in ("A", "C", "G", "T"):
        ans += 1
        a += c
    else:
        ans = max(ans, len(a))
        a = ""
print(ans)
S = input()
T = "ACGT"
ans = 0
cnt = 0
for s in S:
    if s in T:
        cnt += 1
    else:
        if cnt > ans:
            ans = cnt
        cnt = 0
print(ans)
l=input()

if "A" or "G" or "C" or "T" in l:
  ans=0
  num=0
  for i in l:
    if i=="A" or i=="G" or i=="C" or i=="T":
      num+=1
      if num==len(l):
        print(num)
    else:
      ans=max(num,ans)
      num=0
    
  print(ans)
else:
  print(0)
s = input()
L = "ACGT"
ans = ""
ss = ""
for i in range(len(s)):
  if s[i] in L:
    ans += s[i]
    #print(ans,ss)
  else:
    if len(ans)>len(ss):
      
      ss = ans
      ans = ""
print(len(ss))
s = input()
ACGT = ["A","C","G","T"]
ans = 0
ANS = [0]

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

ans=0
for i in range(len(s)-1):
    ch=0
    for j in range(i,len(s)):
        if s[j] in 'ACGT':
            ch+=1
        else:
            ans=max(ans,ch)
            ch=0
        ans=max(ans,ch)
print(ans)
s=list(input())
d=["A","C","G","T"]
ans=0
cnt=0
for c in s:
  if c in d:
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
print(ans)
s = input()

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

tmp_ans = 0
ans = 0
for c in s:
    if c in valid_chars:
        tmp_ans += 1
    else:
        ans = max(tmp_ans, ans)
        tmp_ans = 0

print(ans)
s = input()

ans = 0
for l in range (len(s)-1):
  for r in range(l+1, len(s)):
    cnt = 0
    for str in s[l:r]:
      if str not in ['A','C','G','T']:
        cnt = 0 
        break
      else:
        cnt += 1
    ans = max(ans, cnt)
print(ans)
S = list(input())
maxIndex = len(S)

result = 0
for index in range(len(S)):
    counter = 0
    for tmp in range(index, maxIndex):
        if S[tmp] in ["A", "C", "G", "T"]:
            counter += 1
            if tmp == maxIndex:
                if counter > result:
                    result = counter
                    break
            continue
        if counter > result:
            result = counter
            break
    if result == maxIndex: break

print(result)
S = input()
S = list(S)
str_list =  {"A","C","G","T"}
str_max = 0
print(S)
#print(len(S))
for start in range(len(S)):
    for end in range(start+1, len(S)+1):
        S_list = S[start:end]

        if str_list | set(S_list) == str_list:
            str_max = max(str_max, len((S_list)))
           # print(str(S_list)+'はオッケーでした，記録は'+str(len(set(S_list))))
        #else:
           # print(str(S_list)+'はダメでした')

print(str_max)
S=input()
start=1
end=0
ans=[]
for _ in range(len(S)):
    for i in range(len(S))[end:]:
        if S[i] in {"A","C","G","T"}:
            start=i
            break
    for j in range(len(S))[start:len(S)]:
        end=len(S)
        if S[j] not in {"A","C","G","T"}:
            end=j
            break
    ans.append(end-start)
if max(ans)<0:print(1)
else:print(max(ans))
import re
S = input()
num = len(S)
S = re.sub('[^A|^C|^G|^T]+', ' ', S).split(' ')
print(len(max(S)))
S=input()
cnt=0
ans=0
for i in S:
    if i in ["A","C","G","T"]:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
print(ans)
import itertools

S = list(input())
Idxs = list(itertools.combinations(range(len(S)), 2)) 

def ACGT(Word):
    for w in Word:
        if w not in ["A", "C", "G", "T"]:
            return 0
    return len(Word)

ans = 0

for s in S:
    if s in ["A", "C", "G", "T"]:
        ans = 1
        break


for idx in Idxs:
    tmp = S[idx[0]:idx[1]]
    ans = max(ans, ACGT(tmp))
    
print(ans)
S = input()

len_ACGT = 0
canCount = False
max_len = 0
for s in S:
  if (s in "ACGT"):
    if(canCount == False):
      canCount = True
    len_ACGT += 1
  else:
    if(canCount == True):
      if(len_ACGT > max_len):
        max_len = len_ACGT
      canCount = False
      len_ACGT = 0
print(max_len)
S = input()
tmp=0
ans=0
for s in S:
  if s in 'ACGT':
    tmp+=1
  else:
    ans = max(ans,tmp)
    tmp=0
print(ans)
s = input()

count = 0
for i in range(len(s)-1):
    c=0
    if s[i]!='A' and s[i]!='C' and s[i]!='G' and s[i]!='T':
        continue
    c=1
    for j in range(i+1,len(s)):
        if s[j]!='A' and s[j]!='C' and s[j]!='G' and s[j]!='T':
            break
        else:
            c+=1
    count = c if count<c else count
print(count)
S = str(input())
sam = ['A','C','G','T']
count = 0
for i in range(len(S)):
    if i == 0 and S[i] in sam:
        count+=1
    elif i > 0:
        if count == 0 and S[i] in sam:
            count+=1
        elif S[i] in sam and S[i-1] in sam:
            count+=1
        
print(count)
S = input()
count = 0
count_max = 0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        count += 1
        continue
    else:
        if count_max <= count:
            count_max = count

print(count_max)
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 09:40:38 2020

@author: black
"""


S = list(input())

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

print(ans)
S = input()
ans = ''
t = ''
acgt = 'ACGT'
for s in S:
    if (s in acgt):
        t += s
    else:
        if (len(ans) < len(t)):
            ans = t

if (len(ans) < len(t)):
    ans = t
print(ans)
S=input()

flag =0
ans =0

for i in range(len(S)):
    flag =0
    for j in range(len(S)-i):
        if S[i+j] == 'A' or S[i+j] == 'G' or S[i+j] == 'T' or S[i+j] == 'C':
            flag +=1
        else:
            ans = max(ans,flag)
            flag =0
            break
        
print(ans)
s=input()
tmp = 0
ans = -1
flg= 1
for i in range(len(s)):
  if s[i] in ["A","G","C","T"]:
    tmp += 1
  else:
    if ans <= tmp:
      ans = tmp
      flg = 0
      tmp = 0
print(ans if flg==0 else tmp)
S=input()
res=0
for st in [S[x:y] for x in range(len(S)) for y in range(len(S)) if x<=y]:
    for c in st:
        if not c in ('A','C','G','T'):
            break
    else:
        if res<len(st):
            res=len(st)
print(res)
s = input()
a = ['A','T','G','C']
ans = []
c = 0

for i in s:
    if i in a:
        c += 1
    else:
        ans += [c]
        c = 0
if ans == []:
    print(len(s))
else:
    print(max(ans))
S=input()

C = 0
cnt = 0
for i in range(len(S)):
  if S[i] in ["A","C","G","T"]:
    cnt+=1
  else:
    C = max(C,cnt)  
    cnt = 0
print(C)
S = input()
mode = 0
now = 0
k = []
for i in range(len(S)):
    if str(S[i]) == "A" or str(S[i]) == "T" or str(S[i]) == "G" or str(S[i]) == "C":
        if mode == 0:
            mode = 1
            now += 1
        else:
            now += 1
    else:
        k.append(now)
        now = 0
        mode = 0
if len(k) == 0:
    print(0)
else:
    print(max(k))
S = input()
cut = 0
total = ''
for s in S:
    for i in ['A', 'C', 'G', 'T']:
        if i == s:
            total = total + i

if total:
    print(len(total))
else:
    print(0)
s=input()
mx=0
for i in range(len(s)):
  a=s[:-i]
  for j in range(len(s)-i):
    b=a[j:]
    if b.count('A')+b.count('C')+b.count('G')+b.count('T')==len(b):
      mx=max(mx,len(b))
print(mx)
l = ('A', 'T', 'C', 'G')
S = input()

ans = [0]
res = 0
for i in range(len(S)):
    if S[i] in l:
        res += 1
    elif res != 0:
        ans.append(res)
        res = 0

print(max(ans))
s = list(input())
m = 0
for i in range(len(s)):
    c = 0
    if s[i] == "A" or s[i] == "T" or s[i] == "G" or s[i] == "C":
        c += 1
        for j in range(1,len(s)-i-1):
            if s[i+j] == "A" or s[i+j] == "T" or s[i+j] == "G" or s[i+j] == "C":
                c += 1
            else:
                if c > m:
                    m = c
print(m)
s = input()
max_len=0
for i in range(len(s)):
    for j in range(i+1, len(s)):
        cut = s[i:j]
        flag = True
        for k in range(len(cut)):
            if cut[k] not in ["A", "C", "G", "T"]:
                flag = False
        if flag:
            max_len = max(max_len, len(cut))

print(max_len)
S = input()
ACGT = ["A","C","G","T"]
 
count=0
ans=0
 
for i in range(len(S)):
    if S[i] in ACGT:
        count+=1
    else:
        ans=max(ans,count)
 
ans=max(ans,count)
print(ans)
S = input()
count = 0
maxlength = 0
for s in S:
    if s in ['A','C','G','T']:
        count += 1
    else:
        maxlength = max(count, maxlength)
        count = 0
print(maxlength)
S = str(input())
ans = 0
for i in range(len(S)):
    count = 0
    fr = 0
    if S[i] == "A" or "T" or "C" or "G":
        count += 1
        for j in range(i+1, len(S)):
            if fr == 0 and S[j] == "A"  or  S[j] == "T"  or  S[j] == "C"  or  S[j] == "G":  
                count += 1
                print(S[j])
            else:
                fr += 1
    if ans < count:
        ans = count
print(ans)
string = input()

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

count = 0
lengths = [0]
for s in string:
    if s in char:
        count += 1
    else:
        lengths.append(count)
        count = 0

print(max(lengths))
n = input()
li = []
count = 0
s = ""
for i in range(len(n)):
    if n[i] == "A" or n[i] == "G" or n[i] == "C" or n[i] == "T":
        s += "a"
    else:
        s += "b"
for i in range(len(n)):
    if s[i] == "a":
        count += 1
    else:
        li.append(count)
        count = 0
li.append(count)
print(max(li))
print(li)
S = input()

answer = ''
for char in S:
    includes = ['A', 'C', 'G', 'T']
    is_included = char in includes
    if not is_included: continue

    answer += char

answer = len(answer)

print(answer)
s = input()
acgt = ["A","C","G","T"]
ans = 0
for i in range(len(s)):
	for l in range(1,len(s)):
		t = s[i:l].replace("A","").replace("C","").replace("G","").replace("T","")
		if len(t) == 0:
 			if len(s[i:l]) > ans:
	  			ans = len(s[i:l])
		
print(ans)
s = input()

acgt = ['A', 'C', 'G', 'T']
count = 0
ans = 0

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

print(ans)
S = input()
T = set(list('AGCT'))

ans = 0
for l in range(len(S)):
    for r in range(l + 1, len(S) + 1):
        if set(S[l: r]) < T:
            ans = max(ans, r - l)

print(ans)
a = 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
  else:
    c = max(c, b)
    b = 0
print(c)
S = input()
ACGT = 'ACGT'
ans = 0
temp = 0
for x in S:
    if x in ACGT:
        temp += 1
    else:
        ans = max(ans, temp)
        temp = 0
print(ans)
s = input()
ACGT = ["A", "C", "G", "T"]

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

for i in S:
    if i in ACGT:
        s += i
        l.append(s)
    else:
        l.append(s)
        s = ""

print(len(max(l)))
S = input()
ans, cnt = 0, 0
for x in list(S):
    if x in ['A', 'C', 'G', 'T']:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
print(ans)
a=str(input())
count=0
ans=0
for i in range(len(a)):
    if a[i]== "A" or a[i]== "C" or a[i]== "G" or a[i]== "T" :
        count+=1
    else:
        ans=max(ans,count)
        count=0
print(ans)
a=input()
total=0
total2=0
i=0
while True:
    if i==len(a)-1:
        break
    elif a[i]=="A" or a[i]=="T" or a[i]=="C" or a[i]=="G":
        total+=1
        i+=1
    else:
        i+=1
        if total2<total:
            total2=total
        total=0
if total2<total:
    print(total)
else:
    print(total2)
acgt = ["A", "C", "G", "T"]
ans = 0
count = 0
for i in input():
  if i in acgt:
    count += 1
  else:
    ans = max(ans, count)
    count = 0
print(ans)
S=input()
T='ATCG'
 
flag =0
ans =0
 
for i in range(len(S)):
    flag =0
    for j in range(i,len(S)-i):
        if S[j] == 'A' or S[j] == 'G' or S[j] == 'T' or S[j] == 'C':
            flag +=1
            ans = max(ans,flag)
        else:
            break
        
print(ans)
s = input()

ans=0
for i in range(len(s)-1):
    ch=0
    for j in range(i,len(s)):
        if s[j] in 'ACGT':
            ch+=1
        else:
            ans=max(ans,ch)
            ch=0
    ans=max(ans,ch)
print(ans)
S = list(input())
ans = 0
for i in range(len(S)):
    res = 0
    for j in range(i, len(S)):
        if S[j] in ["A", "T", "G", "C"]:
            res += 1
        else:
            ans = max(ans, res)
            break
print(ans)
n = input()
count=0
m = 0
for s in n:
  if s =="A" or s == "C" or s == "G" or s== "T" :
    count+=1
  else:
    m =max(m,count)
    count=0
print(m)
s = list(input())
max = 0
cnt = 0
D = ["A","C","G","T"]
for i in s:
    if i in D:
        cnt += 1
    else:
        if max < cnt:
            max = cnt
        cnt = 0
print(max)
S = input()
N = len(S)
cnt = 0
ans = 0
for i in range(N):
    for j in range(i, N):
        if S[j] in ['A', 'C', 'G', 'T']:
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
print(ans)
s = input()

acgt = ["A","C","G","T"]
tmp = 0
ans = 0
for x in list(s):
    if x in acgt:
        tmp += 1
    else:
        ans = max(ans,tmp)
        tmp = 0

print(ans)
s=input()
count = 0
ans = 0
for i in s:
    if i in ['A','C','G','T']:
        count += 1
    else:
        ans = max(ans, count)
        count = 0
print(ans)
import re
S = str(input())
acgt = re.compile(r"[A,C,G,T]*")
s = re.findall(acgt, S)
print(len(max(s)))
S = input()
n = len(S)

length = 0

for s in range(n-1):
    if S[s] not in ["A", "C", "G", "T"]:
        continue
    length = 1
    for e in range(s+1, n):
        if S[e] not in ["A", "C", "G", "T"]:
            break
        length = max(length, e-s+1)

print(length)
target = set(["A", "C", "G", "T"])

S = list(input())

tmp = 0
ans = 0
for i in S:
    print(i)
    if i in target:
        print("aaa")
        tmp+=1
    else:
        ans = max(tmp,ans)
        tmp = 0

ans = max(tmp,ans)
print(ans)
n = input()
l = []
v = []
for t in n:
  if t == 'A' or t == 'C' or t == 'G' or t == 'T':
    v.append(t)
  else:
    l.append(v)
    v = []
l.append(v)
print(len(max(l)))
a=[i for  i in input()]
st=['A','C','G','T'] ; ct=0 ; maxx=0
for i in a:
    if i in st:
        ct+=1
    else:
        maxx=max(maxx,ct)
        ct=0
print(maxx)
S = input()
length = 0
count = 0

for i in range(len(S)):
    for char in S[:i]:
        if char in "AGCT":
            count += 1
        else:
            length = max(length, count)
            count = 0
    count = 0

print(length)
S = list(input())
P = set(["A","C","T","G"])
count = 0
if P&set(S) == set():
  print(0)
  exit()
else:
  for i in range(0,len(S)-1):
    for j in range(i+1, len(S)):
      if set(S[i:j+1])-P == set():
        count = max(count,j+1-i)
        
print(count)
s=list(input())
num=0
check=["A","T","C","G"]
ans_list=[]
num=0
ans=0
for i in range(len(s)):
    if s[i] in check:
        num=num+1
    else:
        ans=max(ans,num)
        ans_list.append(ans)
        num=0
print(ans)
S = input()
ans = 0
l = 0
for c in S:
  if c in 'ATCG':
    l += 1
  else:
    ans = max(ans, l)
    l = 0
print(ans)
s=input()
cnt=0
ans=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
print(ans)
S = list(map(str,input()))
count = 0
ans = 0

for i in range(len(S)):
    if S[i] in ["A","T","G","C"]:
        count += 1
    else:
        ans = max(ans,count)
        count = 0
print(ans)
def li():
    return list(map(int, input().split()))


def mi():
    return map(int, input().split())


def ii():
    return int(input())


S = input()
ACGT = ["A", "C", "G", "T"]

length = 0

for i in range(len(S)):
    if S[i] in ACGT:
        for j in range(i, len(S)):
            if S[j] not in ACGT:
                length = max(j - i, length)
                break

print(length)
s = input()
items = ['A', 'T', 'G', 'C']
length = 0
maxLen = 0

for i in s:
    if i in items:
        length += 1
    else:
        if length > maxLen:
            maxLen = length

        length = 0

print(maxLen)
s=input()

ans=0
count=0
for i in s:
    if i in 'ACGT':count+=1
    else:
        ans=max(ans,count)
        count=0
print(ans)
S = input()
ACGT = ["A","C","G","T"]
 
ans = 0 
ans_lis = [0]
 
for i in range(len(S)):
    if S[i] in ACGT:
        ans = ans + 1 
    elif S[i] not in ACGT:
        ans_lis.append(ans)
        ans = 0 
 
print(max(ans_lis))
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

s = S()
ans = 0
temp = 0
for i in s:
    if i in 'ACGT':
        temp += 1
    else:
        ans = max(ans,temp)
        temp = 0
print(ans)
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
    
ans = []
for i in range(0,len(s)-2):
  for j in range(i,len(s)):
    if 0 not in s[i:j+1]:
      ans.append(j+1-i)
      
if ans == []:
  print(0)
else:
  print(max(ans))
S = list(input())

count = 0
record = 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 count > record:
            record = count

print(record)