peterverebics/CodeNet_Python_118 huggingface dataset:
S = input()
valid = ['A', 'T', 'C', 'G']
count = 0
max_len = 0

for i in range(len(S)):
    for j in range(i, len(S)):
        if S[j] in valid:
            count += 1
        else:
            break
    if count > max_len:
        max_len = count
    count = 0

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

ref = ["A","C","G","T"]
lst = []

for i in range(N):
    ans = ""
    if s[i] in ref:
        while s[i] in ref:
            ans = ans + s[i]
            i += 1
            if i >= N:
                break
    lst.append(ans)

ans = -float("inf")
for i in range(N):
    ans = max(ans, len(lst[i]))

print(ans)
s = input()
n = len(s)
acgt = "ACGT"
cnt = 0
flag = 0
ans = 0
for i in range(n):
  if s[i] in acgt:
    cnt += 1
    ans = max(ans,cnt)
  else:
    cnt = 0
print(ans)
s=list(input())
n=len(s)
ans=[]
if n==1:
  if s.pop() in list('ATCG'):
    print(1)
    exit()

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())
d=["A","G","C","T"]
a=[]
b=[]
x=[]
for i in range(len(s)):
    a.append(s[i:])
for j in a:
    for k in range(len(j)-1):
        b.append(j[:-k-1])
ans=a+b
for i in ans:
    if set(i) <= set(d):
        x.append(len(i))
    else:
        pass
if x:
  print(max(x))
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) == 1 for c in S[i : j + 1]):
            ans = max(ans, j-i+1)
print(ans)
S = list(input())
ans, p = 0, ""
for s in S:
    if s in  ["A", "C", "G", "T"]:
        p += s
    else:
        p = ""
    ans = max(ans, len(p))
    
print(ans)
s = input()
ACGT = 'ACGT'
ans = 0
cnt = 0
for i in s:
  if i in ACGT:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
print(max(ans,cnt))
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    S = input()
    acgt = ('A', 'C', 'G', 'T')
    ans = 0
    l = 0
    while (l < len(S)) and (len(S)-l > ans):
        r = l+1
        while (r < len(S)+1) and (S[r-1] in acgt):
            r += 1
        ans = max(r-1-l, ans)
        l += 1

    print(ans)

if __name__ == '__main__':
    resolve()
S = str(input())

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

s = input()

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

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

print(ans)
x = ["A","G","C","T"]
ans=0
now=0
for i in input():
  if i in x:
    now+=1
  else:
    now = 0
  ans=max(now,ans)
print(ans)
import sys
input=sys.stdin.readline

def main():
    s = input()
    cnt = 0
    trial = 0
    for i in s: # 本当に全通りO（n^2）やらなくても最長の部分がわかれば良い
        if i in "ACGT":
            trial += 1
        else:
            cnt = max(cnt, trial)
            trial = 0
    print(cnt)

if __name__=="__main__":
    main()
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)
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

s = ns()
ans = 0
c = 0
acgt = ["A", "C", "G", "T"]
for si in s:
    if si in acgt:
        c += 1
    else:
        ans = max(c, ans)
        c = 0
if c != 0:
    ans = max(c, ans)
print(ans)
S = input()

ACGT = 'ACGT'

count = []
tmp_num = 0
for i in S:
    if i in ACGT:
        tmp_num += 1
    elif i not in ACGT:
        count.append(tmp_num)
        tmp_num = 0
count.append(tmp_num)

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

count=0
a_list=[]
b_list=["A", "C", "G", "T"]
num=len(s)

for i in range(num):
    if s[i] in b_list:
        count+=1
    else:
        a_list.append(count)
        count=0
a_list.append(count)

print(max(a_list))
ans=0;now=0
for i in list(input()):
    if i in {"A","G","C","T"}:now+=1
    elif now:ans=max(now,ans);now=0
print(max(now,ans))
import math
import itertools
import statistics
#import collections
#x = int(input())
#k, n = (map(int, input().split()))
#A= (map(int, input().split()))

#x個の赤りんごp　y緑りんごq c個無色r
#n =  list(map(int, input().split()))
s = input()
max_ = 0
count = 0

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

    if max_ <= count:
        max_ = count
    
    

print(max_)
def atcoder(s):

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

    for i in s:
        if i in acgt:
            count += 1
        else:
            count = 0
        ans = max(ans, count)
    return ans

def main():
    s = list(str(input()))
    print(atcoder(s))

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

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

max_len = 0
cnt = 0
for i in s:
    if i in acgt:
        cnt += 1
        if max_len < cnt:
            max_len = cnt
    else:
        cnt = 0
print(max_len)
S = input()
result = 0

streak = 0
for s in S:
    if s == 'A' or s == 'T' or s == 'G' or s == 'C':
        streak += 1
    else:
        result = max(streak, result)
        streak = 0
result = max(streak, result)
print(result)
S=input()
N=len(S)
ans=0
for i in range(N):
  for j in range(i,N):
    if all('ATGC'.count(c) for c in S[i:j+1]):
      ans=max(ans,j-i+1)
print(ans)
S = input()

res = []
tmp = []
for s in S:
    if s == 'A' or s == 'C' or s == 'G' or s == 'T':
        tmp.append(s)
    else:
        res.append(len(tmp))
        tmp = []
res.append(len(tmp))
print(max(res))
S=list(input())
n=len(S)
ans=0
ansl=[0]
for i in range(n):
    if S[i]=="A" or S[i]=="C" or S[i]=="G" or S[i]=="T":
        ans+=1
    else:
        ans=0
    ansl.append(ans)
ansl.sort(key=int)
print(ansl[n])
s=input()
n=len(s)
res=0
for i in range(n):
  if s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T':
    ans=1
    j=i+1
    while j<n:
      if s[j]=='A' or s[j]=='C' or s[j]=='G' or s[j]=='T':
        ans+=1
        j+=1
      else:
        break
  else:
    continue
  res=max(res,ans)
print(res)
S = input()

max_len = 0
cnt = 0
acgt = ['A', 'C', 'G', 'T']

for i in range(len(S)):
    if S[i] in acgt:
        cnt += 1
        if max_len < cnt:
            max_len = cnt
    else:
        cnt = 0

print(max_len)
s = input()

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

if result < count:
  result = count

print(result)
S = input()
L = len(S)
ACGT = ['A', 'C', 'G', 'T']
ans = 0

for i in range(L):
    for j in range(i, L):
        sub_S = S[i:j+1]
        if all([s in ACGT for s in sub_S]):
            if len(sub_S) > ans:
                ans = len(sub_S)

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

print(maxcount)
def all_part_string(s):
    r = range(len(s))
    return [s[i:j+1] for i in r for j in r if s[i:j+1] != '']

def contains_only(s, l):
    return False if [a for a in [e for e in s if e not in l] if a != ''] else True

if __name__ == '__main__':
    s = input()
    ss = all_part_string(s)
    o = [e for e in ss if contains_only(e, "ACGT")]
    print(0 if len(sorted(o, key=len, reverse=True)) == 0 else len(sorted(o, key=len, reverse=True)[0]))
S = input()

N = len(S)

ACGT = {"A", "C", "G", "T"}

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

print(ans)
N = list(input())
m = 0
cnt = 0
for x in N:
    
    if x == 'A' or x == 'C' or x == 'G' or x == 'T':
        cnt += 1
    else:
        m = max(cnt, m)
        cnt = 0

m = max(cnt, m)

print(m)
S = list(input())

count = 0
ans = 0
flg = False

for word in S:
    if word=="A" or word=="C" or word=="G" or word=="T":
        flg = True
    else:
        flg=False
        count = 0
    
    if flg:
        count += 1
    ans = max(ans,count)

print(ans)
s = input()
left = 0
ans = 0
for right in range(0,len(s)):
  if s[right] == "A" or s[right]== "C"or s[right]== "T"or s[right]=="G":
    pass
  else:
    left=right+1
  ans = max(ans,right-left+1)
print(ans)
S = input()
l = []
ans = ("A", "C", "G", "T")
A = 0
flag = False

for i in range(len(S)):
    for j in range(i+1, len(S)+1):
        l.append(S[i:j])
    
for i in range(len(l)):
    for c in l[i]:
        if c not in ans:
            flag = True
            break
    if flag:
        flag = False
        continue
    A = max(A, len(l[i]))

print(A)
import re

m = re.findall(r'[ATCG]+', input())
if m:
    print(max([len(x) for x in m]))
else:
    print('0')
S = input()
acgt = ('A', 'C', 'G', 'T')
right = 0
res = -1
for left in range(len(S)):
    while right < len(S) and S[right] in acgt:
        right += 1
    res = max(res, right - left)
    if left == right:
        right += 1
print(res)
"""abc122_b"""
S = input()

CNT = 0

ANS = [0]
for s in S:
    if s in "ACTG":
        CNT += 1
    elif CNT != 0:
        ANS.append(CNT)
        CNT = 0
ANS.append(CNT)

print(max(ANS))
def main():
  #n = int(input())
  s = input()
  #s = input().split()
  #a,b = list(map(int,input().split()))
  #a = [input() for i in range(n)]
  #a = [int(input()) for i in range(n)]
  #a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = 0
  count = 0
  lis = []
  
  for i in s:
    if i in "ACGT":
      count += 1
      ans = max(ans,count)
    else:
      count = 0
  print(ans)

if __name__ == '__main__':
  main()
S=input()
# ACGT
lis=[]
for x in range(len(S)):
	alt=len(S)-x
	for y in range(alt):
		y=len(S)-y
		ts=S[x:y]
		ca=ts.count('A')
		cg=ts.count('G')
		cc=ts.count('C')
		ct=ts.count('T')

		if len(ts)==ca+cg+cc+ct:
			lis.append(len(ts))
if lis !=[]:
	print(max(lis))
else:
	print(0)
s = input()
list_s = list(s)
k = 0
ans = []
for i in range(len(list_s)):
    c = list_s[i]
    if c == "A" or c == "C" or c == "G" or c == "T":
        k += 1
    else:
        ans.append(k)
        k = 0
if k != 0:
    ans.append(k)
print(max(ans))
s = input()
S = ""
for i in s:
    if i in "ACGT":
        S+="1"
    else:
        S+="0"
        
ans = max(list(map(len,S.split("0"))))
print(ans)
S = str(input())
m=0
point=0
for i in S:
    if i == "A" or i == "G" or i == "C" or i == "T":
        point+=1
    else:
        point*=0
    m = max(m, point)
print(m)
import re
print(max(map(len, re.split('[^ACGT]', input()))))
s=input()
Flag=True
cnt=0
ans=0
for i in range(len(s)):
    if s[i] in 'ACGT':
        cnt+=1

    else:
        ans=max(ans,cnt)
        cnt=0
ans=max(ans,cnt)
print(ans)
import re
print(len(max(re.split('[^ACGT]',input()),key=len)))
S=input()
ans=0
tmp=0
for i in range(len(S)):
	if S[i]=="A" or S[i]=="C" or S[i]=="G" or S[i]=="T":
		tmp+=1
	else:
		ans=max(ans,tmp)
		tmp=0
ans=max(ans,tmp)
print(ans)
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
input = lines.pop(0)
acgt = tuple("ACGT")
max_num_list = []
max_num = 0
for c in input:
    if c in acgt:
        max_num += 1
    else:
        max_num_list.append(max_num)
        max_num = 0
max_num_list.append(max_num)
print(max(max_num_list))
s = input()
ans = 0
g = 0
for i in range(len(s)):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        g += 1
        if g > ans:
            ans = g
    else:
        g = 0;
print(ans)
S = input()
res = 0
counts=0
for i in range(len(S)):
  if S[i] in "ACGT":
    counts+=1
  else:
    res=max(res,counts)
    counts=0
print(max(res,counts))
import sys
input = sys.stdin.buffer.readline
input = sys.stdin.readline

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())

def main():
	ACGT="ACGT"
	s=input()
	ans=0
	cnt=0
	for i in s:
		if i in ACGT:
			cnt+=1
		else:
			cnt=0
		ans=max(ans,cnt)
	print(ans)














if __name__ == "__main__":
	main()
S = input()
ans = 0
ACGT = ["A","C","G","T"]
for i in range(len(S)):
    for j in range(i,len(S)+1):
        clipped_list = list(S[i:j])
        clipped = set(clipped_list)
        for acgt in ACGT:
            try:
                clipped.remove(acgt)
            except:
                pass
        if clipped == set():
            ans = max(ans,len(clipped_list))

print(ans)
N = input()
ACGT = ["A", "C", "G", "T"]

ans = [0]
count = 0
for n in N:
    if n in ACGT:
        count += 1
    else:
        ans.append(count)
        count = 0
ans.append(count)
print(max(ans))
S = input()
cnt = 0
tmp = 0

for i in S:
    if  i in ['A', 'C', 'G', 'T']:
        tmp+=1
    elif cnt < tmp:
        cnt = tmp
        tmp = 0
if cnt < tmp:
    print(tmp)
else:
    print(cnt)
import re
s = input()
len_s = len(s)
max_ACGT = 0

for i in range(len_s):
    for j in range(i + 1, len_s):
        partial_s = s[i:j]
        if len(re.findall('A|C|G|T', partial_s)) == len(partial_s) and len(partial_s) > max_ACGT:
            max_ACGT = len(partial_s)

print(max_ACGT)
s=input()
l=len(s)
ans=0
for i in range(l):
  if s[i] in ['A','T','G','C']:
    ans+=1
print(ans)
import sys
input = sys.stdin.readline


def read():
    S = input().strip()
    return S,


def solve(S):
    alphabets = ['A', 'C', 'G', 'T']
    max_count = 0
    count = 0
    for s in S:
        if s in alphabets:
            count += 1
        else:
            max_count = max(max_count, count)
            count = 0
    return max_count


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
print(lo)
s = input()
L = "ACGT"
ans = ""
ss = ""
for i in range(len(s)):
  if s[i] in L:
    ans += s[i]
    flag = True
  else:
    if len(ans)>len(ss):
      ss = ans
      break
print(len(ss))
S = input().strip()
L = len(S)
if len(set(list(S+"ATGC"))) == 4:
    print(L)
    exit()
l = L-1
while True:
    for i in range(L-l):
        if len(set(list(S[i:i+l]+"ATGC"))) == 4:
            print(l)
            exit()
    l -= 1
s = input()

ans = 0
for l in range (len(s)-1):
  for r in range(l+1, len(s)+1):
    cnt = 0
    for str in s[l:r+1]:
      if str not in ['A','C','G','T']:
        cnt = 0 
        break
      else:
        cnt += 1
    ans = max(ans, cnt)
print(ans)
S = input()
ACGT = ['A','C','G','T']
anss = []
for i in range(len(S)):
    tmp_s = ""
    if S[i] in ACGT:
        tmp_s += S[i]
        for j in range(i+1,len(S)-i):
            if S[j] in ACGT:
                tmp_s += S[j]
            else:
                break
    anss.append([len(tmp_s),tmp_s])
anss.sort()
print(anss[-1][0])
S=input()

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

max_length = 0
length = 0
for word in S:
    if word in acgt:
        length+=1
    else:
        if length!=0:
            if max_length<length:
                max_length=length
            length=0
print(max_length)
def resolve():
    S = input()
    cnt = 0
    maxC = 0
    for s in S:
        if s in "ACGT":
            cnt += 1
        else:
            maxC = max(maxC, cnt)
            cnt = 0
    print(maxC)


resolve()
s = input()
i = 0
ans = 0
while i < len(s):
    if s[i] == "A" or s[i] == "T" or s[i] == "C" or s[i] == "G":
        for j in range(len(s) - i):
            if s[i + j] != "A" and s[i + j] != "T" and s[i + j] != "C" and s[i + j] != "G":
                break
        
        ans = max(ans, j)
    
    i += 1
print(ans)
s = list(input())
ans = 0
cnt = 0
for i in range(len(s)):
    if s[i] not in ["A", "C", "G", "T"]:
        ans = max(ans, cnt)
        cnt = 0
    else:
        cnt += 1
print(ans)
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
        
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)
s =input()
l =len(s)
count=0
for i in range(l):
    x =s[i]
    if x =='A' or x =='C' or x =='G' or x =='T':
        count +=1
        for j in range(i+1, l):
            x =s[j]
            if x =='A' or x =='C' or x =='G' or x =='T':
                count +=1
            else:
                break

print(count)
S = input()

max_length = 0
length = 0
for s in S:
    if s in ["A", "C", "G", "T"]:
        length += 1
    else:
        if length > max_length:
            max_length = length
        length = 0
print(max_length)
import re
pattern = re.compile('[ACGT]+')
S = input()
print(len(max(re.findall(pattern, S), default='')))
s = input()

mx  = 0
n = len(s)
kensa = ["A", "C", "G", "T"]

for i in range(n):
    for j in range(i,n-1):
        mj = s[i:j+1]
        bl = True
        for l in range(len(mj)):
            if mj[l] not in kensa:
                bl = False
                break
        if bl & mx<len(mj):
           mx = len(mj)

print(mx)
S = input()
N = len(S)
ACGT = []
others = 'BDEFHIJKLMNOPQRSUVWXYZ'
for i in range(N):
    fl = True
    for j in range(i+1,N+1):
        tmp_S = S[i:j]
        M = len(tmp_S)
        for k in range(M):
            if tmp_S[k] in others:
                fl = False
        if fl==False:
            break
        ACGT.append(tmp_S)
print(ACGT)
len_ACGT = [len(x) for x in ACGT]
print(max(len_ACGT)) if len(len_ACGT)>0 else print(0)
string_data = list(input())

N = len(string_data)
match_word_lits = ['A', 'C', 'G', 'T']
count = 0
max_word = 0
for i in range(N):
    if string_data[i] in match_word_lits:
        count += 1
    else:
        if max_word < count:
            max_word = count
        count = 0

print(max_word)
a = list(input())
ans = []
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.append(count)
        count = 0
if len(ans) == 0:
    ans.append(count)
print(max(ans))
acgt = ['A', 'T', 'G', 'C']
word = input()
res = 0
count = 0

for s in word:
    if s in acgt:
        count += 1
    elif res < count:
        res = count

print(res)
import re

S=input()
ans = sorted((re.findall("[AGCT]*", S)), reverse=True, key=len)
print(ans[0])
S=str(input())
M=['A','C','G','T']
c=0
cmax=0
for i in range(len(S)):
  if S[i] in M:
    c+=1
  else:
    if c>cmax:
      cmax=c
    c=0
print(cmax)
s = input()

cnt = 0
ans = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        cnt += 1
    elif i != "A" and i != "C" and i != "G" and i != "T":
        ans = max(ans,cnt)
        cnt = 0

print(ans)
S=input()
l=len(S)
x=['A','C','G','T']
a=0
m=0
for i in range(l):
    if S[i] in x:
        a+=1
    else:
        if a>m:
            m=a
        a=0
print(m)
s = list(input())
count = [0]
x = ["A","T","G","C"]
c = 0
for i in range(len(s)):
    if (s[i] in x) == True:
        c += 1
    else:
        count.append(c)
        c = 0
count.append(c)
print(count)
s = list(input())
l = len(s)
a=0
m=0
for i in range(l):
  if s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T':
    a+=1
  else:
    a = max(m, a)

print(a)
S = input()
S = list(S)

str_max = 0
for start in range(len(S)):
    for end in range(start, len(S)+1):
        if {"A","C","G", "T" } |set(S[start:end+1]) == {"A","C","G", "T" }:
            str_max = max(str_max, -start+end+1)

print(str_max)
s=input()
tmp = 0
ans = -1
flg= 1
for i in range(len(s) -1):
  if s[i] in ["A","G","C","T"]:
    tmp += 1
  else:
    if ans <= tmp:
      ans = tmp
      flg = 0
      tmp = 0
if s[-1] in ["A","G","C","T"]:
  ans = max(ans, tmp +1)

print(ans if flg==0 else tmp)
ans = []
cnt = 0

for s in input():

    if not s in "ACGT":
        ans.append(cnt)
        continue
    
    cnt += 1

ans.append(cnt)

print(max(ans) )
if __name__ == "__main__":
    S = input()
    word_arr = ["A","T","G","C"]
    max_count,count = 0,0
    for c in S:
        if c in word_arr:
            count += 1
        else:
            max_count = max(count,max_count)
            count = 0
    print(max_count)
try:
    S = input()
    count = 0
    res = []
    for i in range(len(S)):
        if S[i] in ["A", "C", "G", "T"]:
            count += 1
        else:
            res.append(count)
            count = 0
    print(max(res))
except:
    print(0)
s = input()
cnt = 0
li = [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
print(max(li))
checklist=["A","C","G","T"]
sn = list(input())

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

print(answer)
print(sn)
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(ans)
# ABC122 B - ATCoder

S=str(input())
AC = 'ATGC'
N = []
count=0
for i in range(len(S)):
    if S[i] not in AC:
        N.append(i)
    else:
        count+=1
if count == len(S):
    print(count)
    exit()

M = N[0]
for j in range(len(N)-1):
    M = max( N[j+1] - N[j],M)
print(M)
S = list(input())
ACGT = ["A", "C", "G", "T"]
count = 0
Max = 0
for s in S:
    if s in ACGT:
        count += 1
    else:
        if count > Max:
            Max = count
        count = 0
print(Max)
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [[input().split()] for _ in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

s=s0()

ans=0
c=0
for x in s:
    if x in "ACGT":
        c+=1
    else:
        ans=max(ans,c)
        c=0
print(ans)
S=input()
count=0
max_count=-1
for i in range(len(S)):
    if S[i]=="A" or S[i]=="C" or S[i]=="G" or S[i]=="T":
        count=count+1
    else:
        if max_count<count:
            max_count=count
            count=0
print(max_count)
S = input()

ans = 0
ans_lis = [0]

for i in range(len(S)):
    if S[i] in "ACGT":
        ans = ans + 1
    else:
        ans_lis.append(ans)
        ans = 0
        ans_lis.append(ans)

print(max(ans_lis))
s =  list(input())
ans = []
for mozi in s:
    if(mozi == "A" or mozi == "G" or mozi == "C" or mozi == "T"):
        ans.append(mozi)
    else:
        break
print("".join(ans))
s = input()

c = []
x = ["A","G","C","T"]


for i in range(0,len(s)-1):
  if(s[i] in x):
    t = 1
    for j in range(i+1,len(s)):
      if(s[j] in x):
        t = t + 1
      elif(s[j] not in x or j == len(s)):
        c.append(t)
if(len(c)==0):
  c.append(0)
print(max(c))
S=input()
count=0
max_count=-1
for i in range(len(S)):
    if S[i]!="A" and S[i]!="C" and S[i]!="G" and S[i]!="T":
        count=count+1
    else:
        if max_count<count:
            max_count=count
        count=0
print(max_count)