peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
count = 0
mx = 0
for i in s:
    if i=="A" or i=="C" or i=="G" or i=="T":
        count += 1
        mx = max(count,mx)
    else:
        count = 0
print(mx)
def main():
    S = input()

    s = set()
    s.add('A')
    s.add('C')
    s.add('G')
    s.add('T')

    max_count = 0

    count = 0
    for c in S:
        if c in s:
            count += 1
        else:
            max_count = max(max_count, count)
            count = 0

    max_count = max(max_count, count)
    print(max_count)


if __name__ == '__main__':
    main()
s = input()

chain = 0
max_chain = 0
for i in range(len(s)):
    if (s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T'):
        chain += 1
    else:
        if(chain > max_chain):
            max_chain = chain
            chain = 0
    if (i == len(s)-1):
        if(chain > max_chain):
            max_chain = chain
            chain = 0
            
print(max_chain)
string = input()
ans = 0
score = 0
ok = set('ACGT')
for c in string:
    if c in ok:
        score += 1
    else:
        ans = max(ans, score)
        score = 0
ans = max(ans,score)
print(ans)
S = input()
count = 0
koremade = 0
for i in range(0,len(S)):
    if S[i] in 'ACGT':
        count += 1
        if i == len(S)-1:
           if koremade <= count:
               koremade = count 
    else:
        if koremade <= count:
            koremade = count
        count = 0
print(koremade)
S=input()
res=0
for i in range(len(S)+1):
    for j in range(i):
        t=True
        s=S[j:i]
        for k in range(len(s)):
            if(s[k]!='A' and s[k]!='C' and s[k]!='G' and s[k]!='T'):
                t=0
                break
        if(t):
            res=max(res,len(s))
print(res)
S=input()

ans=0
temp=0
l=['A','C','G','T']

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

print(ans)
def ATCoder(S):
    count = 0
    res = 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
            if count > res:
                res = count
        else:
            count = 0
    return res



if __name__ == "__main__":
    S = str(input())
    print(ATCoder(S))
import re
S = str(input())
acgt = re.compile(r"[A,C,G,T]*")
s = re.findall(acgt, S)
print(max(map(len,s)))
s = str(input())

res = 0
max_res = 0
for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
        res += 1
        if res > max_res:
            max_res = res
    else:
        res = 0
print(max_res)
S = input()
max_ctr = 0
ctr = 0

for i in range(len(S)):
    if (S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G'):
        ctr += 1
        max_ctr = max(ctr, max_ctr)
    else:
        ctr = 0

print(max_ctr)
S = input()
maxlen=count=0
isT = True
for i in range(len(S)):
  if S[i] == "T":
    isT = True
  if S[i] == "T" or S[i] == "G" or S[i] == "C" or S[i] == "A":
    count += 1
  else:
    if isT and maxlen < count:
      maxlen = count
    count = 0
    isT = False
    
if isT and maxlen < count:
  maxlen = count

print(maxlen)
S = input()
acgt = ['A', 'C', 'G', 'T']

c = 0
ans = 0

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

print(ans)
s = input()
s += "B"# AGCT以外の適当な文字

max_len = 0

count = 0
for i in s:
    if i in "ACGT":
        count += 1
    else:
        max_len = max(max_len,count)
        count = 0

print(max_len)
ss=['A','G','C','T']
s=list(input())
ans=0
for i in range(len(s)):
  if s[i] in ss:
    j=i
    cnt=0
    while j<len(s):
      if s[j] in ss:
        cnt+=1
        j+=1
      else:
        break
      
    ans=max(ans,cnt)
      
print(ans)
S = input()
l = {"A", "C", "G", "T"}

ans = 0
tmp = ""
for s in S:
  if s in l:
    tmp += s
    if len(tmp) > ans:
      ans = len(tmp)
  else:
    tmp = ""

print(ans)
S = input()

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

print(max(li))
s = input()
ans = 0
total = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "G" or s[i] == "C" or s[i] == "T":
        total += 1
    else:
        ans = max(ans, total)
        total = 0
print(max(ans, total))
from sys import stdin

def main():
    word = stdin.readline()
    max = 0
    count = 0
    for i in range(len(word)):
        if word[i] == "A" or word[i] == "C" or word[i] == "G" or word[i] == "T":
            count += 1
        elif max < count:
            max = count
            count = 0
    print(max)

if __name__ == '__main__':
    main()
S = input()
atgc = ["A", "T", "G", "C"]
anset = set()
L = 0
for i in range(len(S)):
    if S[i] in atgc:
        L += 1
    else:
        anset.add(L)
        L = 0
    if i == len(S)-1:
        anset.add(L)

print(max(anset))
s = input()

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

print(count)
S = list(input())

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

res = 0

t = 0

for s in S:
    if s in acgt:
        t += 1
    else:
        res = max(res, t)
        t = 0

res = max(res, t)

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

ans = 0
tmp_ans = 0
for i in s:
    if i in t:
        tmp_ans += 1
    else:
        ans = max(tmp_ans, ans)
        tmp_ans = 0
ans = max(tmp_ans, ans)
print(ans)
S = input()
N = len(S)

ans = 0
tmp = 0
ACGT = {"A", "C", "G", "T"}
i = 0
while i < N:
  if S[i] in ACGT:
    tmp += 1
  else:
    ans = max(ans, tmp)
    tmp = 0
  i += 1
    
ans = max(ans, tmp)  

print(ans)
s = input()
sum = 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':
        sum += 1
    else: sum = 0
    if sum >= max: max = sum
print(max)
s=input()
tar="ACGT"
res=0
ans=0
for ch in s:
    if ch in tar: ans+=1
    else:
        if ans>res: res=ans
        ans=0
if ans>res: res=ans
print(res)
s = input()
count = 0
max_count = 0
for c in s:
  if c in ['A','C','G','T']:
    count += 1
    if max_count < count:
      max_count = count
  else:
    count = 0
print(max_count)
s=input()
ans=0
cur=0
ACGT=["A","C","G","T"]
for ss in s:
  if ss in ACGT:
    cur+=1
  else:
    ans=max(cur,ans)
    cur=0
print(max(ans,cur))
s=input()
ans=0
for i in range(len(s)):
    for j in range(len(s)):
        new_s=list(s[i:(len(s)-j)])
        if all((i in ["A","T","G","C"]) for i in new_s) and len(new_s)>ans:
            ans=len(new_s)
print(ans)
ok='AGCT'
s=list(input())
cnt=0
ans=0
for si in s:
  if si in ok:
    cnt+=1
  else:
    ans = max(ans,cnt)
    cnt=0
ans = max(ans,cnt)
print(ans)
S = input()
T = ['A', 'C', 'G', 'T']
ans, cnt = 0, 0

for i in range(len(S)):
    if S[i] in T:
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
print(ans)
S = input()
ans = 0
for i in range(len(S)):
  for j in range(i, len(S)):
    if all('ACTG'.count(c) == 1 for c in S[i:j+1]):
      ans = max(ans, j+1-i)
print(ans)
S = list(input())

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

print(max(ans))
s = input()

max = 0
count = 0

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

print(max)
import re
ans = max(map(len, re.findall("[ACGT]*", input())))
print(ans)
def S(): return input()
S = S()
ans = 0
temp = 0
for x in S:
    if x in 'ACGT':
        temp += 1
    else:
        temp = 0
    ans = max(temp,ans)
print(ans)
from operator import itemgetter
s = input()
l = len(s)
ans = []
flag = False 
for i in range(l):
    if flag:
        if s[i] in "AGCT":
            continue
        else:
            ans.append([i-start,start,i])
            flag = False
    if s[i] in "AGCT":
        flag = True
        start = i 
else:
    if flag:
        ans.append([l-start,start,l])
ans.sort(key=itemgetter(0),reverse=True)
#print(s[ans[0][1]:ans[0][2]])
if ans:
    print(ans[0][0])
else:
    print(0)
s=input()
n=len(s)
ans=0
for i in range(n):
  for j in range(i,n):
    if all("ACGT".count(c) for c in s[i:j+1]):
      ans=max(ans,j-i+1)
print(ans)
s = input()
ans = 0
cache = 0
for c in s:
    if c in ["A", "C", "G", "T"]:
        cache += 1
    else:
        if cache > ans:
            ans = cache
            cache = 0
if cache > ans:
    ans = cache
print(ans)
def resolve():
    S = input()
    ans, cnt = 0, 0
    for s in S:
        if s == 'A' or s == 'C'or s == 'G' or s == 'T':
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
    ans = max(ans, cnt)
    print(ans)

resolve()
# B
s = list(input())

count = 0
l = []
for i in range(len(s)):
    if s[i] == 'A':
        count += 1
        continue
    elif s[i] == 'C':
        count += 1
        continue
    elif s[i] == 'G':
        count += 1
        continue
    elif s[i] == 'T':
        count += 1
        continue
    else:
        l.append(count)
        count = 0
l.append(count)

print(max(l))
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(i, len(check)):
            if check[i : j + 1].count(0) == 0:
                if result < len(check[i:j + 1]):
                    result = len(check[i:j + 1])

    print(result)

if __name__ == '__main__':
    abc122_b()
S=input()
m=0
count=0
for s in S:
    if s in "ACGT":
        count += 1
    else:count=0
    m=max(m,count)
print(m)
s=list(input())
dna = ["A","T","G","C"]
res=[0]
x=0
for i in range(len(s)):
    if s[i] in dna:
        x+=1
    else:
        res+=[x]
        x=0
print(max(x,max(res)))
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip() # ignore trailing spaces 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

def main():
    s = ns()
    ACGT = "AGCT"
    ans = 0
    tmp = 0
    for i in s:
        if i in ACGT:
            tmp += 1
        else:
            ans = max(ans, tmp)
            tmp = 0
    ans = max(ans, tmp)
    print(ans)
    return

if __name__ == '__main__':
    main()
S=list(input())
line=[]
A=["A","C","G","T"]
num_list=[]
flag=False
for s in S:
    if s in A:
        line.append(s)
        flag=True
    elif flag:
        num_list.append(len(line))
        line=[]
        flag=False
num_list.append(len(line))
if len(num_list)==0:print(0)
else:
    print(max(num_list))
s = input()
acgt = ['A','C','G','T']
ans = 0
p = 0
for i in range(len(s)):
    if s[i] in acgt:
        p += 1
    else:
        ans = max(ans,p)
        p = 0
print(max(ans,p))
S = input()
ACGT = 0
ans = 0

for x in S:
    if x == 'A' or x == 'C' or x =='G' or x == 'T':
        ACGT += 1
    else :
        ACGT = 0
    ans = max(ans, ACGT)

print(ans)
S = input()
def check(S): #1 moji
    if S in "ATGC":
        return True
    else:
        return False

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

print(ans)
S = input()
N = len(S)

ans = 0
for i in range(N+1):
    for j in range(i+1, N+1):
        l = 0
        for c in 'ACGT':
            l += S[i:j].count(c)
        if l == j - i:
            ans = max(ans, l)
print(ans)
s = input()

l = 0
ans = 0
for c in s:
    if c in ('A', 'C', 'G', 'T'):
        l += 1
        ans = max(ans, l)
    else:
        l = 0
print(ans)
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,len(s[i:j+1]))
print(ans)
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()

d = len(s)
ans = [0] * 10
tmp = 0
for i in range(d):
    if s[i] in "ACGT":
        ans[tmp] += 1
    else:
        tmp += 1
print(max(ans))
S = input()
ans = 0
lsATCG = ['A','T','C','G']
count = 0
for s in S:
    if s in lsATCG:
        count += 1
    else:
        ans = max(ans,count)
        count = 0
ans = max(ans,count)
print(ans)
S=[0]+list(input())
L=[0]
SET=["A","G","C","T"]
SET=set(SET)
for i in range(1,len(S)):
    if S[i] not in SET:
        L.append(0)
    else:
        L.append(L[-1]+1)
print(max(L))
s = input()

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

sub = []
for i in range(len(s)):
  for j in range(i+1,len(s)+1):
    tmp = s[i:j]
    flag = True
    for k in range(len(tmp)):
      if tmp[k] in lis:
        pass
      else:
        flag = False
    if flag: sub.append(tmp)
      
ma = 0
for i in sub:
  l = len(i)
  if l > ma: ma = l
print(ma)
import math
import sys
s = input()
def isACGT(n):
    for i in range(len(n)):
        if (n[i] != 'A' and n[i] != 'C' and n[i] != 'G' and n[i] != 'T'):
            return False
    return True
ans=0
for i in range(len(s)):
    for j in range(1, len(s)+1):
        if (isACGT(s[i:j]) and len(s[i:j]) > ans):
            ans = len(s[i:j])
print(ans)
S=input()

ans=0
tmp=0
for i in range(len(S)):
    if S[i] in ("A","C","G","T"):
        tmp+=1
    else:
        ans=max(ans,tmp)
        tmp=0
ans=max(ans,tmp)
print(ans)
import re

split = re.split('[^ACGT]', input())

print(max(map(len, split)))
s = str(input())
cnt = 0
cnt_list = []

for i in range(len(s)):
    if s[i] in 'ACGT':
        cnt += 1
        cnt_list.append(cnt)
    else:
        cnt = 0
        cnt_list.append(0)
print(max(cnt_list))
s = input().strip()
n = len(s)

acum = [0] * (n + 1)
acgt = ['A', 'C', 'G', 'T']

for i in range(1, n + 1):
    if s[i - 1] in acgt:
        acum[i] = acum[i - 1] + 1
    else:
        acum[0] = 0

print(max(acum))
S = input()
n = len(S)

length = 0

for s in range(n):
    for e in range(s, n):
        if all("ACGT".count(c)==1 for c in S[s:e+1]):
            length = max(length, e-s+1)

print(length)
import re
print(max(map(len, re.findall("[ACGT]*", input()))))
S = input()
a = 'ACGT'
memo = []
cnt = 0
for s in S:
  if s in a:
    cnt += 1
  else:
    cnt = 0
  memo.append(cnt)
print(max(memo))
s = input()

max = 0
tmp = 0

for c in s:
    if c in ['A', 'C', 'G', 'T']:
        tmp += 1
        if tmp > max:
            max = tmp
    else:
        tmp = 0

print(max)
s=list(input())
#print(s)
ans = -1
counter = 0
for i in range(len(s)):
  if s[i] == "A" or s[i] == "T" or s[i] == "G" or s[i] == "C":
    #print("ATGC")
    counter += 1
  else:
    counter = 0
  ans = max(ans,counter)
  
print(ans)
S = list(input())

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

print(res)
s = list(input())
ans = 0
for i in range(len(s)):
    for j in range(i, len(s)):
        # print(s[i:j+1])
        if all(x == 'A' or x == 'C' or x == 'G' or x == 'T' for x in s[i:j+1]):
            # print('Yes')
            if ans < len(s[i:j+1]):
                ans = len(s[i:j+1])
        # if expression:
        #     pass
    # print(s[:i], len(s[:i]))

print(ans)
#python3
def main():
    s = input()
    ans = 0
    cnt = 0
    for i in range(len(s)):
        if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):
            cnt += 1
        else:
            cnt = 0
        ans = max(ans, cnt)
    print(ans)
main()
s=input()
char=["A","C","G","T"]
ans=0
cnt=0
for i in range(len(s)):
    if s[i] in char:
        cnt+=1
    else:
        ans=max(ans,cnt)
        cnt=0
ans=max(ans,cnt)
print(ans)
S=list(input())

maxlen=0
for i in range(len(S)):
    for j in range(i,len(S)):
        for k in range(i,j+1):
            #cnt=0
            if S[k]!='A' and S[k]!='C' and S[k]!='G' and S[k]!='T':
                break
            if k==j and j-i+1>maxlen:
                maxlen=j-i+1
print(maxlen)
import re
S = input()
s = re.split('[BDEFHIJKLMNOPQRSUVWXYZ]',S)
print(max(map(len,s)))
S = input()
cnt=0
ans = 0
sets = {"A","T","C","G"}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
ans = max(ans,cnt)
print(ans)
s = list(input())
d = ["A","C","G","T"]
cnt = 0
ans = 0
for c in s:
    if c in d:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0
print(max(cnt,ans))
S = list(input())
n = len(S)
ACGT = ["A","C","G","T"]
ans = 0
for i in range(n):
    if S[i] in ACGT:
        if i == n-1:
            ans = max(ans,1)
        else:
            streak = 1
            for j in range(i+1,n):
                if S[j] in ACGT:
                    streak += 1
                else:
                    break
            ans = max(ans,streak)

print(ans)
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
ans = max(ans, temp)
print(ans)
s = list(input())
a = ""
ans = 0
for c in s:
    if c in ("A", "C", "G", "T"):
        a += c
    else:
        ans = max(ans, len(a))
        a = ""
print(max(ans, len(a)))
s=input()
clist=['A','C','G','T']
count=0
a=[]
for i in s:
  if i in clist:
    count+=1
  else:
    a.append(count)
    count=0
a.append(count)
print(max(a))
s=input()
x=['A','T','C','G']
a=[0]*len(s)
if s[0] in x:
  a[0]=1
for i in range(1,len(s)):
  if s[i] in x:
    a[i]=a[i-1]+1
print(max(a))
s = input()
acgt = ["A","C","G","T"]
c = ""
for i in s:
  if i in acgt:
    c+=i
  else:
    c+= " "
l = c.split()
if l:
	print(len(max(l, key=lambda x:len(x))))
else:
  print(0)
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
ans = max(ans,cnt)
        
print(ans)
s = input()
l = 0
max_num = 0

for str in s:
    if str in 'ATCG':
        l += 1
    else:
        max_num = max(max_num, l)
        l = 0
max_num = max(max_num, l)
print(max_num)
l = ('A', 'T', 'C', 'G')
S = input()

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

print(ans)
S = input()
ans = 0
i = 0
for i in range(len(S)):
    for j in range(i,len(S)):
        if S[j]=='A' or S[j]=='G' or S[j]=='T' or S[j]=='C':
            ans = max(ans,j-i+1) 
        else:
            break
print(ans)
# print(S)
s = str(input())
arr = []
count = 0
ans = 0

for i in s:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        arr.append(1)
    else:
        arr.append(0)

for i in range(0, len(arr)):
    if arr[i] == 0:
        count = 0
    else:
        count += 1
        ans = max(ans, count)
print(ans)
checklist=['A','C','G','T']
sn = list(input())

answer = 0
count = 0
for s in sn :
  if s in checklist:
    count += 1
  else :
    count = 0
  answer = max(answer,count)

print(answer)
import re
from itertools import groupby
S = input()
S = re.sub("[ACGT]", "?", S)
ans = 0
cnt = 0
for s,l in groupby(S):
    if s=="?":
        ans = max(ans, len(list(l)))
print(ans)
s=input()
ans=0
cnt=0
for ss in s:
 if ss in 'ATGC':
  cnt+=1
 else:
  ans=max(ans,cnt)
  cnt=0
print(max(ans,cnt))
S = input()

answer = ''
number_of_consecutive_times = 0
maxium_number_of_consecutive_times = 0
for char in S:
    is_included = char in ['A', 'C', 'G', 'T']

    if is_included:
        number_of_consecutive_times += 1
        maxium_number_of_consecutive_times = max(
            number_of_consecutive_times,
            maxium_number_of_consecutive_times,)
    else:
        number_of_consecutive_times = 0

print(maxium_number_of_consecutive_times)
def main():
    str = input()

    max_len = 0
    len_acgt = 0
    for i in range(len(str)):
        if str[i] in "ACGT":
            len_acgt += 1
        else:
            len_acgt = 0

        max_len = max(max_len, len_acgt)

    print(max_len)


if __name__ == "__main__":
    main()
# https://atcoder.jp/contests/abc122/tasks/abc122_b


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

ans = 0
n = 0
for s in S:
    if s in SPECIAL:
        n += 1
    else:
        if ans < n:
            ans = n
        n = 0
if ans < n:
    ans = n

print(ans)
s = input()
possible_answers = [0]
possible_answer = 0
acgt = ['A', 'C', 'G', 'T']

for i in range(len(s)):
    if s[i] in acgt:
        possible_answer += 1
    else:
        possible_answers.append(possible_answer)
        possible_answer = 0

possible_answers.append(possible_answer)
print(max(possible_answers))
def readinput():
    s=input()
    return s

def main(s):
    
    maxlen=0
    templen=0
    for i in range(len(s)):
        if(s[i]=='A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T'):
            templen+=1
        else:
            maxlen=max(maxlen,templen)
            templen=0
        
    return max(maxlen,templen)

if __name__=='__main__':
    s=readinput()
    ans=main(s)
    print(ans)
S = input()

mx = 0
cnt = 0
for s in S:
    if s not in ['A', 'T', 'C', 'G']:
        mx = max(mx, cnt)
        cnt = -1
    cnt += 1
mx = max(mx, cnt)
print(mx)
# coding: utf-8
S = input()
c = 0
m = 0
for i in S:
    if 'A' == i or 'C' == i or 'G' == i or 'T' == i:
        c += 1
        m = max(c, m)
    else:
        c = 0
print(m)
s = input()

ans = 0
cnt = 0
for i in s:
    if i in 'ACGT':
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0

ans = max(ans, cnt)

print(ans)
S = input()
maximum = 0
cnt = 0
for i in range(len(S)):
    if S[i] in ['A','T','C','G']:
        cnt += 1
        maximum = max(maximum,cnt)
    else:
        cnt = 0
print(maximum)
S = input()
 
count = [0]
counter = 0
 
for i in S:
  if i == "A" or i == "C" or i == "G" or i == "T":
    counter += 1
    count.append(counter)
  else:
    counter = 0

print(max(count))
s = input()

res = []

for i in range(len(s)):
    for j in range(i, len(s)):
        check = s[i:j+1]
        if len(check) == check.count("A")+check.count("T")+check.count("C")+check.count("G"):
            res.append(len(check))
print(0 if res == [] else max(res))
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

#ここから書き始める
s = input()
n = len(s)
ans = 0
cnt = 0
for i in range(n):
    if s[i] in ["A", "C", "G", "T"]:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
ans = max(ans, cnt)
print(ans)
s=input()
l = [0]
cnt = 0
for i in s:
    if i =='A'or i == 'C' or i == 'G' or i == 'T':
        cnt +=1
        l.append(cnt)
    else:
        cnt = 0
print(max(l))
import sys
from itertools import combinations
import math


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 a in s:
    if a in 'ACGT':
        temp += 1
    else:
        temp = 0
    ans = max(ans, temp)
print(ans)
s = input()

max_cnt = 0
cnt = 0
for i in s:
    if i in ['A', 'C', 'G', 'T']:
        cnt += 1
    else:
        max_cnt = max(cnt, max_cnt)
        cnt = 0

print(max(max_cnt, cnt))
s = input()

max_value = 0
count = 0
for c in s:
  if c in "ACGT":
    count += 1
  else:
    count = 0
  max_value = max(max_value, count)
print(max_value)
s = input()
maxl = 0
l = 0
for i in range(len(s)):
  if s[i] in 'ACGT':
    l += 1
  else:
    if maxl < l:
      maxl = l
    l = 0
if maxl < l:
  maxl = l
print(maxl)
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()
A =set()
t = 0
for i in range(len(S)):
  if S[i] == 'A' or S[i] == 'G' or S[i] == 'C' or S[i] == 'T':
    t += 1
  else:
    A.add(t)
    t = 0
A.add(t)
print(max(A))
s = input()
ans = 0
l = 0
for c in s:
  if c == 'A' or c == 'C' or c == 'G' or c == 'T':
    l += 1
  else:
    ans = max(ans, l)
    l = 0
ans = max(ans, l)
print(ans)