peterverebics/CodeNet_Python_118 huggingface dataset:
S = input()

ans = 0
tans = 0
for c in S:
    if c in "ACGT":
        tans += 1
        ans = max(ans, tans)
    else:
        tans = 0
print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

s = input()
n = len(s)
ans = 0
acgt = set(['A', 'C', 'G', 'T'])
for i in range(n):
    for j in range(i + 1, n + 1):
        t = s[i:j]
        flag = 1
        for k in t:
            if k not in acgt:
                flag = 0
                break
        if flag:
            ans = max(ans, len(t))
print(ans)
s = input()
word = ['A', 'C', 'G', 'T']
count = 0
tmp = 0

for i in s:
    if word.count(i) == 1:
        tmp += 1
    else:
        tmp = 0

    if count < tmp:
        count = tmp
print(count)
s=input()
l=len(s)
count=0
ans=0
for i in range(l):
  if s[i]=='A' or s[i]=='G' or s[i]=='C' or s[i]=='T':
    count+=1
  else:
    if count>ans:
      ans=count
    count=0
if count>ans:
  ans=count
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
    m =max(m,count)
  else:
    count=0
print(m)
S = input()

d = set(['A', 'T', 'C', 'G'])
len_ = 0
ans = 0
for s in S:
    if s in d:
        len_ += 1
    else:
        # この部分書き換える
        # if len_ > ans:
        #     ans = len_
        ans = max(len_, ans)
        len_ = 0
ans = max(len_, ans)
print(ans)
# 初期入力
import sys
input = sys.stdin.readline
S =input().strip()

#ACGTが連続しているか判定
count =0
count_list=[0]
for i in S:
    if i in "ACGT":
        count +=1
        count_list.append(count)
    else:
        count =0
print(max(count_list))
S = input()
L = [s in "ACGT" for s in S]
ans, cnt = 0, 0
for l in L:
  if l == True:
    cnt += 1
  else:
    ans = max(ans, cnt)
    cnt = 0
ans = max(ans, cnt)
print(ans)
s=input()
temp=0
ans=0
tar="ACGT"
for ch in s:
  if ch in tar:
    temp+=1
  else:
    ans=max(ans, temp)
    temp=0

print(max(ans,temp))
b = input()
n = len(b)
ans = 0
kar = 0
for i in range(n):
    for j in range(i,n):
        if b[j] == "A" or b[j] == "T" or b[j] == "G" or b[j] == "C":
           kar += 1
        else:
            if kar > ans:
                ans = kar
            kar = 0
        if j == n - 1:
            if kar > ans:
                ans = kar
            kar = 0
print(ans)
s = input()
acgt = ['A', 'C', 'G', 'T']
cnt = [0]*len(s)
for i in range(len(s)):
    for j in range(i, len(s)):
        if s[j] in acgt:
            cnt[i] += 1
        else:
            break
print(max(cnt))
s = input()
ans=0
now=0
for a in s:
    if(a=='A' or a=='G' or a=='C' or a=='T'):
        now+=1
    else:
        now=0
    ans=max(ans,now)
print(ans)
s = str(input())
w = ""
l = []
for i in s:
    if i=='A' or i=='C' or i=='G' or i=='T':
        w += i
    else:
        l.append(len(w))
        w = ""
l.append(len(w))
print(max(l))
a = ["A", "T", "G", "C"]
b = input()
ans = 0
cnt = 0
for i in range(len(b)):
    if b[i] in a:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans,cnt)
print(ans)
S = input()

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

ans = 0
ok = False
tmp = 0
for s in S:
    if not ok:
        if s in acgt:
            ok = True
            tmp += 1
        else:
            pass
    elif ok:
        if s in acgt:
            tmp += 1
        else:
            ok = False
            ans = max(tmp,ans)
            tmp = 0
ans = max(tmp,ans)
print(ans)
s = input()
ans = 0
m = 0
for i in s:
  if i in "ACGT":
    m += 1
    if m > ans:
      ans = m
  else:
    m = 0
print(ans)
s= input()

import re

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

length = [len(p) for p in str_s]

if length==[]:
    print(0)
else:
    print(max(length))
s = input()
s += 'q'
ans = ''
lst = []
for ss in s:
    if ss in ['A', 'C', 'G', 'T']:
        ans += ss
    else:
        lst.append(len(ans))
        ans = ''
print(max(lst))
s = input()
ans = 0
DNA = ['A', 'C', 'G', 'T']
count = 0
for i in range(len(s)):
    c = s[i]
    if c in DNA:
        count += 1
    else:
        ans = max(ans, count)
        count = 0
    if i == len(s) - 1:
        ans = max(ans, count)
print(ans)
import sys
S = input()
ok = ["A","G","T","C"]
for l in range(len(S),0,-1):
  for i in range(0,len(S)-l+1):
    for s in S[i:i+l]:
      if s in ok:
        continue
      else:
        break
    else:
      print(l)
      sys.exit()
else:    
  print(0)
s = input()
ans = [0]
for i in range(len(s)):
    for j in range(len(s)):
        l = s[i:j+1]
        if  all(x=='A'or x=='C' or x=='G' or x=='T' for x in l):
            ans.append(len(l))
print(max(ans))
S = input()

ans = 0

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

print(ans)
a = list(input())
ans = 0
count = 0
for i in a:

    if i == 'A':
        count +=1
    elif i == 'C':
        count+=1
    elif i == 'G':
        count+=1
    elif i == 'T':
        count+=1
    else:
        ans = max(ans ,count)
        count = 0

print(max(ans,count))
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)
            seq=0
    ans = max(ans,seq)
    print(ans)
s = input()
cnt = 0
ans = 0
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
    cnt += 1
  else:
    ans = max(ans, cnt)
    cnt = 0
  
print(max(ans, cnt))
S = input()
S_num = [0]*len(S)

for i in range(len(S)):
    if S[i] in ["A", "T", "G", "C"] :
        if i == 0:
            S_num[i] = 1
        else:
            S_num[i] = S_num[i-1]+1

print(max(S_num))
s = input()
score=0
ans=[]
for i in s:
  if i in {"A", "T", "C", "G"}:
    score+=1
  else:
    score=0
  ans.append(score)
print(max(ans))
#!/usr/bin/env python3

S = input()

s = ''
base = ('A', 'C', 'G', 'T')
max_len = 0

for c in S:
    if c not in base:
        s = ''
        continue

    s += c

    current_len = len(s)
    if max_len < current_len:
        max_len = current_len

print(max_len)
S = str(input())

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

print(ans)
import re

S = input()
L = re.findall("[AGCT]+", S)
LL = [len(x) for x in L ]
if LL:
    print(max(LL))
else:
    print(0)
# https://atcoder.jp/contests/abc122/tasks/abc122_b


def is_acgt(c):
    acgt = ['A', 'C', 'G', 'T']

    return c in acgt


if __name__ == "__main__":
    S = input()

    result = 0
    tmp_result = 0
    for c in S:
        if (is_acgt(c)):
            tmp_result += 1
            result = max(result, tmp_result)
        else:
            tmp_result = 0

    print(result)
S = input()
n = len(S)

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

print(ans)
s = list(str(input()))
for i in range(len(s)):
    if s[i] in 'ATCG':
        s[i] = 1
    else:
        s[i] = 0
def shakutori(a, k):
    right, cnt = 0, 0
    for left in range(len(a)):
        while right < len(a) and a[right] == k:
            right += 1
        cnt = max(cnt, right - left)
        if right == left:
            right += 1
    return cnt
print(shakutori(s, 1))
s = input()
count = 0
ans = 0
for i in s:
    if i in'AGCT':
        count += 1
    else:
        count = 0
    ans = max(ans, count)
print(ans)
S=input()
N=len(S)
ans=0
d=set(list("AGCT"))

for i in range(N+1):
    for j in range(N+1):
        s=S[i:j]
        if set(list(s))<=d:
            ans=max(ans,len(s))
            
print(ans)
s = input()
atgc = ["A","T","G","C"]
mylist = [0]
for i in range(len(s)):
    if s[i] in atgc:
        mylist.append(mylist[-1] +1)
    else:
        mylist.append(0)
print(max(mylist))
s = input()
ans = 0
memo = 0
for i in s:
    if i == 'A' or i == 'T' or i == 'C' or i == 'G':
        memo += 1
    else:
        ans = max(ans, memo)
        memo = 0
print(max(ans, memo))
import re

s = input()

max_len = 0
for i in range(len(s)):
    for j in range(i, len(s)):
        a = s[i:j + 1]
        if re.fullmatch(r'(A|C|G|T)*', a):
            # print(a)
            max_len = max(max_len, len(a))

print(max_len)
S = input()

s = []

for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        s.append(i)

ans = 0
if len(s) == 1:
    ans = 1

count = 1
for i in range(len(s)-1):
    if s[i] + 1 == s[i+1]:
        count += 1
    else:
        count = 1
    if ans < count:
        ans = count
print(ans)
s=input()

score=0

for i in range(len(s)):
    for j in range(i,len(s)):
        isbad = 0
        for k in range(i,j+1):
            if s[k] != "A" and s[k] != "C" and s[k] != "G" and s[k] != "T": 
                isbad=1
                break
        if isbad==0:
            score = max(j+1-i,score)
            # print(s[i:j+1])
        
print(score)
def solution():
    s = input()
    ans = len = 0
    for c in s:
        if c in 'ACGT':
            len += 1
            ans = max(ans, len)
        else:
            len = 0
    print(ans)

solution()
a=input()
b=0
c=('A','C','G','T')
d=0
for i in range(len(a)):
	if a[i] in c:
		b+=1
		if b>d:
			d=b
	else:
		b=0
print(d)
s = input()
n = len(s)
acgt = ["A", "C", "G", "T"]
ans = 0
cnt = 0
for i in range(n):
    if s[i] in acgt:
        cnt += 1
        #print(ans, cnt, i)
    else:
        ans = max(ans, cnt)
        #print(ans, cnt, i)
        cnt = 0
print(max(ans, cnt))
S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j+1]
    if s.strip("A C G T") == "":
      l.append(s)
if len(l) == 0:
  print(0)
  exit()
      
m = sorted(l, reverse=True, key=len)
print(len(m[0]))
items = ['A', 'C', 'G', 'T']

def chkmax(a, b):
    return a if a > b else b

res = 0
cnt = 0
for c in list(input()):
    if c in items:
        cnt += 1
        res = chkmax(res, cnt)
    else:
        cnt = 0
print(res)
acgt = list('ACGT')
s = input()
ans = 0
count = 0
for i in s:
    if i in acgt:
        count += 1
        ans = max(count, ans)
    else:
        count = 0
print(ans)
S = input()
ans = 0
for i in range(len(S)):
    j = 0
    while i+j < len(S):
        if S[i+j:i+j+1] in ('A', 'C', 'T', 'G'):
            j += 1
        else:
            break
    ans = max(ans, j)

print(ans)
S=input()
ans = 0
for i in range(1,len(S)+1):
    for j in range(0,len(S)-i+1):
        if all([c in ["A","T","G","C"] for c in S[j:j+i]]):
            ans = i
print(ans)
li = list(input())
ans = 0
num = 0
for i in range(len(li)):
    if li[i] == 'A' or li[i] == 'G' or li[i] == 'C' or li[i] == 'T':
        num += 1
    else:
        if ans < num:
            ans = num
        num = 0
if ans == 0:
    ans = num
if ans < num:
    ans = num
print(ans)
s = input()
ans = 0
for start in range(len(s)):
    for end in range(len(s)):
        tmps = s[start:end+1]
        if set(tmps) <= {"A","G","C","T"}:
            ans = max(ans,len(tmps))
print(ans)
S=str(input())
S2=[]
ans=0
for i in range(len(S)):
  for j in range(len(S)+1):
    S2=S[i:j]
    que=len(S2)
    S2=S2.replace("A","")
    S2=S2.replace("G","")
    S2=S2.replace("C","")
    S2=S2.replace("T","")
    if S2=="":
      if que>ans:
        ans=que
    S2=[] 
print(ans)
import sys
def S(): return sys.stdin.readline().rstrip()
S = S()
ans,temp = 0,0
for x in S:
    if x in 'ACGT':
        temp += 1
        ans = max(ans,temp)
    else:
        temp = 0
print(ans)
def is_ACGT(c):
    return c == "A" or c == "C" or c == "G" or c == "T"

S = input()

ans = 0
for i in range(len(S)):
    j = 0
    while i+j < len(S) and is_ACGT(S[i+j]):
        j += 1
    ans = max(ans, j)

print(ans)
S = input()
ans = 0
seq = 0
for i in S:
    if i in ['A', 'C', 'G', 'T']:
        seq += 1
    else:
        ans = max(ans, seq)
        seq = 0
print(max(ans, seq))
s = input()
acgt = ["A","C","G","T"]
ans = 0
tmp = 0
for i in range(len(s)):
    if s[i] in acgt:
        tmp += 1  
    else:
        ans = max(ans, tmp)
        tmp = 0
ans = max(ans, tmp)
print(ans)
S = input()
ACGT = ""
ans = 0
for i in range(len(S)):
    for j in range(len(S)-i):
        if(S[i+j] != "A" and S[i+j] != "C" and S[i+j] != "G" and S[i+j] != "T"):
            break
        ACGT = ACGT + S[i+j]
    ans = max(ans,len(ACGT))
    ACGT = ""
print(ans)
s = input()
ans = 0
tmp = 0
for c in s:
  if c in ['A', 'T', 'G', 'C']:
    tmp += 1
  else:
    ans = max(ans, tmp)
    tmp = 0
ans = max(ans, tmp)
print(ans)
s=input()
ans=0
c=0
d={"A","C","G","T"}
for i in range(len(s)):
    if not s[i] in d:
        ans=max(ans,c)
        c=0
    else:
        c+=1
ans=max(ans,c)

print(ans)
def check(s):
    return s == 'A' or s == 'C' or s == 'G' or s == 'T'


S = input()
ans = 0
tmp = 0
for s in S:
    tmp = tmp + 1 if check(s) else 0
    ans = max(ans, tmp)
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
            ans = max(ans, tmp)
        else:
            tmp = 0

print(ans)
#!/usr/bin/env python3
def main():
    S = input()

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


if __name__ == '__main__':
    main()
S=list(map(str,input()))
L=[0]*(len(S)+1)
for i in range(len(S)):
    if S[i] in "ACGT":
        L[i]+=1
        L[i+1]+=L[i]
print(max(L))
# Code for B - ATCoder
# Use input() to fetch data from STDIN
s = input()

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

m = []
c = 0
for x in s:
    if not x in acgt:
        m.append(c)
        c = 0
    else:
        c += 1
m.append(c)

print(max(m))
#abc 106 b yakusu
s=input()
ans=0
cnt=0
acgt=["A","C","G","T"]
for i in range(len(s)):
    if s[i] not in acgt:
        if ans<cnt:
            ans=cnt
        cnt=0
    else:
        cnt+=1
print(max(ans,cnt))
check = ["A", "C", "G", "T"]

s = input()
ans = 0
tmp = 0

for i in range(len(s)):
    if s[i] in check:
        tmp += 1
    else:
        ans = max(ans,tmp)
        tmp = 0
else:
    ans = max(ans,tmp)
        
print(ans)
S = input()

answer = 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:
    count = 0
  answer = max(answer, count)
print(answer)
S = input()
count = 0
MAX = 0
for s in S:
    if s in ['A','C','G','T']:
        count += 1
    else:
        MAX = max(MAX,count)
        count = 0
MAX = max(MAX,count)
print(MAX)
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
if cnt>ans:
    ans = cnt
print(ans)
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = input()


l = len(S)
ans = 0
for i in range(l):
    for j in range(i + 1, l + 1):
        for c in S[i:j]:
            if not c in ['A', 'C', 'G', 'T']:
                break
        else:
            ans = max(j - i, ans)
print(ans)
S = input()
ATGC = "ATGC"

cnt_ = 0
for i in range(len(S)):
    cnt = 0
    for j in range(i,len(S)):
        if S[j] in ATGC:
            cnt += 1
        else:
            break
    
    if cnt > cnt_:
        cnt_ = cnt

print(cnt_)
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)
s=input()
L=len(s)
cnt=0
ans=0
dic=["A", "G", "C", "T"]

for i in range(L):
    if s[i] in dic:
        cnt+=1
        if cnt > ans:
            ans=cnt
    else:
        if cnt > ans:
            ans=cnt
        cnt=0


print(ans)
#ABC122B
def main():
    import sys
    S = sys.stdin.readline().rstrip()
    #print(S)
    cnt = 0
    ans = 0
    for s in S:
        if s in ['A', 'G', 'C', 'T']:
            cnt +=1
        else:
            ans = max(ans, cnt)
            cnt=0
    
    ans = max(ans, cnt)
    print(ans)   
            
                    
    

if __name__=='__main__':
    main()
ATGC=['A', 'T', 'G', 'C']
S=input()
N=len(S)
maxlen=0
count=0

for i in range(N):
    if S[i] in ATGC:
        count+=1
    else:
        count=0
    if count>maxlen:
        maxlen=count
print(maxlen)
S=input()
count=0
ans=0
for s in S:
    if s in "ACGT":
        count+=1
        ans=max(ans,count)
    else:
        count=0
print(ans)
S=input()
ans=0
for i in range(len(S)):
    cnt=0
    while True:
        if  i>=len(S):
            break
        elif S[i] not in ["A","C","G","T"]:
            break
        else:
            cnt+=1
            i+=1    
    if cnt>ans:
        ans=cnt
print(ans)
# abc122_b.py
s = input()
ans = 0
cnt = 0
for i in s:
    if i == "A" or i=="T" or i=="G" or i=="C" :
        cnt+=1
    else:
        if ans<cnt:
            ans=cnt
            cnt=0
if ans<cnt:
    ans=cnt

print(ans)
S=list(input())
A=[0]*10
c=0
for i in range(len(S)):
  if S[i]=="A" or S[i]=="G" or S[i]=="C" or S[i]=="T":
    A[c]+=1
  else:
    c+=1
print(max(A))
import re

S = input()

pattern = "[A|T|G|C]+"
match_result = re.findall(pattern, S)

ans = 0
for word in match_result:
    if ans <= len(word): ans = len(word)

print(ans)
S = input()
N = len(S)
ans = [0]
x = 0

for i in range(N):
    s = S[i]
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        x += 1
        if i == N -1:
            ans.append(x)
    
    else:
        if x != 0:
            ans.append(x)
        x = 0
    
print(max(ans))
import sys
S = list(input())
X = ["A","C","G","T"]

max_len = 0
cur = 0

for i in S:
    if i in X: cur += 1
    else:
        if cur> max_len:
            max_len = 0
            max_len +=cur
            cur = 0
        else:
            cur = 0

if cur > max_len:
    print(cur)
    sys.exit()

print(max_len)
s = list(input())

now = 0
ans = 0

for i in range(len(s)):
  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
    now += 1
    if ans < now:
      ans = now
  else:
    now = 0

print(ans)
s = input()
ans, sum = 0, 0
for i in range(len(s)):
    cur = s[i]
    if (cur == 'A' or cur == 'T' or cur == 'G' or cur == 'C'):
        sum += 1
    else: sum = 0
    ans = max(ans, sum)
print(ans)
S = input()
ans = 0
l = ["A", "T", "C", "G"]
length = len(S)
for i in range(length):
    if S[i] in l:
        temp = 1
        for j in range(i + 1, length):
            if S[j] in l:
                temp += 1
            else:
                break
        ans = max(temp, ans)
print(ans)
S = input().rstrip()
P = {"A", "C", "G", "T"}
cnt = 0
res = 0
for s in S:
    if s in P:
        cnt += 1
        res = max(cnt, res)
    else:
        cnt = 0
print(res)
import re;print(max(len(i)for i in re.split('[^ACTG]',input())))
S = input()
ans = 0
cnt = 0
acgt = ['A','C','G','T']
for c in S:
    if c in acgt:
        cnt += 1
    else:
        if cnt > ans:
            ans = cnt
            cnt = 0

if cnt > ans:
    ans = cnt

print(ans)
import sys
input=sys.stdin.readline

def main():
    s = input()
    len_s = len(s)
    cnt = 0
    for i in range(len_s):
        trial = 0
        for k in range(i,len_s):
            if s[k] in "ACGT":
                trial += 1
            else:
                cnt = max(cnt,trial)
                break
    print(cnt)

if __name__=="__main__":
    main()
import sys
import numpy as np
import numba
from numba import jit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@jit
def main(s):
  ans = 0
  for j, i in enumerate(s):
    if i=='A' or i=='C' or i=='G' or i=='T':
      cnt = 1
      j += 1
      while s[j]=='A' or s[j]=='C' or s[j]=='G' or s[j]=='T':
        j += 1
        cnt += 1
      ans = max(ans, cnt)
  return ans
        
s = str(readline().split())
print(main(s))
S = input()
n = len(S)
ans = 0
list = ['A', 'G', 'C', 'T']
for i in range(n):
    j = i
    while j < n:
        if S[j] in list:
            j += 1
        else:
            if ans < j - i :
                ans = j - i
            break
    if j == n:
        if ans < j - i :
                ans = j - i
print(ans)
S = input()

l = len(S)

max_cnt = 0
for i in range(l):
    for j in range(i, l):
        res = [1 if s == "A" or s == "C" or s == "G" or s == "T" else 0 for s in S[i : j + 1]]
        if sum(res) == len(res):
            max_cnt = max(sum(res), max_cnt)
print(max_cnt)
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)
s = str(input())
ACGT = {"A", "C", "G", "T"}

ans = 0
for i in range(len(s)):
    for j in range(i, len(s) + 1):
        t = s[i: j]
        for k in t:
            if k not in ACGT:
                break
        else:
            ans = max(ans, len(t))
print(ans)
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

s = input()
chk_str = ""
chk = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        chk_str += s[i]
    else:
        if chk < len(chk_str):
            chk = len(chk_str)
        chk_str = ""
if chk < len(chk_str):
    chk = len(chk_str)
print(chk)
a = list(input())

c = 0
m = 0

for x in a:
    if x in ["A", "C", "G", "T"]:
        c += 1
    else:
        m = max(m, c)
        c = 0

print(max(m, c))
s = list(input())
acgt = ['A', 'C', 'G', 'T']
cnt = 0
ans = 0
for i in s:
  if i in acgt:
    cnt += 1
  else:
    cnt = 0
  ans = max(cnt, ans)
print(ans)
ln = input()
output = ''
a = ''
for i in ln:
    if i == 'A' or i == 'T' or i == 'C' or i == 'G' :
        a += i
    else:
        if len(output) < len(a):
            output = a
        a = ''
if len(output) < len(a):
        output = a
a = ''        
print(len(output))
S = input()
T = S.replace('A','1').replace('C','1').replace('G','1').replace('T','1')
a = 0
for s in range(10):
  if '1'*(10-s) in T:
    a=1
    print(10-s)
    break
if a == 0:
  print('0')
s = input()
ans, temp = 0, 0
for x in s:
    if x in "ACGT":
        temp += 1
    else:
        temp = 0
    ans = max(ans, temp)

print(ans)
s = input()
n = len(s)
res = 0
for i in range(n):
    cnt = 0
    for j in range(i, n):
        if s[j] in "ACGT":
            cnt += 1
        else:
            break
    if cnt >= res:
        res = cnt
print(res)
import re
s = input()

m = re.findall(r'[A|T|G|C]+',s)
if len(m)==0:
    print(0)
else:    
    print(len(max(m,key=len)))
def main():
    s = list(input())
    count_list = [0] * 1
    index = 0
    for i in s:
        if i == "A" or i == "T" or i == "G" or i == "C":
            count_list[index] += 1
        else:
            index += 1
            count_list.append(0)
    
    ans = max(count_list)
    
    print(ans)


if __name__ == '__main__':
    main()
s = input()
ans = 0
temp = 0
for c in s:
  if c in 'ATCG':
    temp += 1
    ans = max(ans, temp)
  else:
    temp = 0
print(ans)
s = input()

ans = 0

for l in range (len(s)):

  for r in range(l+1, len(s)+1):

    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)
ACGT = ["A", "C" ,"G", "T"]
s = input()
ans = 0
temp = 0
for i in s:
  ok = False
  for j in ACGT:
    if i == j:
      ok = True
      temp += 1
  if ok == False:
    ans = max(ans, temp)
    temp = 0
ans = max(ans, temp)
print(ans)
s=input()
ans=''
lis=[]
for i in s:
    if i in 'ATGC':
        ans += i
        if i == s[-1]:
            lis.append(len(ans))
    else:
        lis.append(len(ans))
        ans=''

print((max(lis)))
S = list(input())
Max = 0
count = 0
for i in range(len(S)):
    if S[i]=="A" or S[i]=="T" or S[i]=="C" or S[i]=="G":
        count+=1
        if count>Max:
            Max=count
    else:
        count=0
print(Max)