peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
c = ["A","C","G","T"]
ans = 0
count = 0
f = False
for i,ss in enumerate(s):
    if i == 0 and s[i] in c:
        count = 1
        f = True
        continue
    if f:
        if s[i] in c:
            count += 1
        else:
            ans = max(count,ans)
            count = 0
            f = False
    else:
        if s[i] in c:
            count += 1
            f = True
print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    S = input()
    acgt = ['A', 'C', 'G', 'T']
    ans = 0
    for l in range(len(S)-1):
        for r in range(l+1, len(S)+1):
            if S[r-1] not in acgt:
                ans = max(r-l-1, ans)
                break

    print(ans)

if __name__ == '__main__':
    resolve()
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)
#<3>
S = input()
result = 0
ans = 0
word = ["A","G","C","T"]
for i in S:
    
    if i in word:
        ans += 1
    else:
        result = max(result,ans)
        ans = 0
print(result)
lngs = input()

ACGT = ["A", "C", "G", "T"]
out_list = []
out_list_long = []

for lng in lngs:
    if lng in ACGT:
        out_list += lng
    else:
        if len(out_list) > len(out_list_long):
            out_list_long = out_list
        out_list = []

print(len(out_list_long))
s = input()
count = 0
ans =0
for i in s:
    if i in 'ACGT':
        count +=1
    else:
        ans = max(ans,count)
        count = 0
print(ans)
S = list(input())
F = ["A", "C", "G", "T"]
count = 0
flag = 0
for i in S:
    for j in F:
        if j == i:
            count += 1
    if flag < count:

        flag = count
    else:
        count = 0
print(flag)
b=list(str(input()))
E={"A","C","G","T"}
count=0
ans=0
for moji in b:
	if moji in E:
		count+=1
	else:
		ans=max(ans,count)
		count=0
print(ans)
s=list(input())
t=[]
for i in range(len(s)):
    if s[i]!="A" and s[i]!="C" and s[i]!="G"and s[i]!="T":
        t.append(i)
if len(t)==0:
  print(0)
else:
  t=[-1]+t
  u=[]
  for i in range(len(t)-1):
    u.append(t[i+1]-t[i])
  print(max(u)-1)
S = input()
F = "ATGC"
cnt = 0
n = len(S)
for i in range(n-1):
  for j in range(i+1, n):
    flg = True
    for k in range(i, j):
      flg *= (S[i] in F)
    if flg:
      cnt = max(cnt, j - i)
print(cnt)
import sys
sys.setrecursionlimit(10**6)

s = input()

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

ans = 0
tmp = 0

for ch in s:
    if ch in l:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0
        
print(ans)
c,m=0,0
for i in input():
  if i in "AGCT":
    c+=1
  else:
    if c > m:
      m=c
    c=0
print(m)
# -*- coding: utf-8 -*-
S = list(str(input()))

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

ans = 0
num = 0
for i in range(len(S)):
    if tmp[i] == 1:
        num += 1
    else:
        ans = max(ans, num)
        num = 0
print(ans)
s = input()
code = ['A','T','G','C']
ans = 0
l = len(s)
for i in range(l):
    for j in range(i+1,l):
        t = s[i:j+1]
        if set(t) <= set(code):
            ans = max(ans,j-i+1)
print(ans)
S = input()
ans = 0
for i in range(len(S)):
    for j in range(i+1,len(S)):
        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)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

ans = 0
tmp = 0
for v in s:
    if v in ('A', 'C', 'G', 'T'):
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

print(ans)
S = input()

target = list('ACGT')

count_list = [0] * len(S)
for i in range(len(S)):
    if S[i] in target:
        count_list[i] = 1

max_length = 0
for start in range(len(S)):
    if count_list[start] == 0:
        continue
    for end in range(start, len(S)):
        if count_list[end] == 0:
            break
        
        print(count_list[start : end+1])
        max_length = max(sum(count_list[start : end+1]), max_length)

print(max_length)
n = list(input())

count = 0

for i in range(len(n)):
  word = 0
  flag = 0
  for j in range(i, len(n)):
    if(flag == 0):
      if(n[j] == 'A' or n[j] == 'C' or n[j] == 'T' or n[j] == 'G'):
        word += 1
        flag = 1
    else:
      if(n[j] != 'A' and n[j] != 'C' and n[j] != 'T' and n[j] != 'G'):
        if(count < word):
          count = word
        break
      else:
        word += 1

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

print(max(li))
from math import gcd
s=input()
n=len(s)
ans=0
tmp=0
for i in range(n):
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        tmp+=1
    else:
        ans=max(tmp,ans)
        tmp=0
        
print(ans)
S = input()
n = len(S)

ans = 0
for i in range(1, n+1):
    for j in range(n-i):
        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)
def main():
    s = input()
    n = len(s)
    ans = 0
    for i in range(n):
        for j in range(i + 1, n):
            if set(s[i:j]) - {"A", "C", "G", "T"} == set():
                ans = max(ans, len(s[i:j]))
    print(ans)


if __name__ == "__main__":
    main()
S = input()
N = len(S)
m = 0
for i in range(N):
    for j in range(i+1):
        s = S[j:i]
        l = list(s)
        l = [k for k in l if k not in ["A", "G", "C", "T"]]
        if len(l) == 0:
            m = max(m, i-j)
print(m)
S=str(input())
ans=0
temp=0
for i in range(len(S)):
    if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T':
        temp+=1
    else:
        ans=max(ans,temp)

print(ans)
import sys
from collections import deque
from itertools import *


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

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

print (ans)
s = input()
ans = 0
for i in range(len(s) - 1):
    if s[i] not in {'A', 'C', 'G', 'T'}:
        continue
    length = 1
    for j in range(i + 1, len(s)):
        if s[j] not in {'A', 'C', 'G', 'T'}:
            break
        length += 1
    ans = max(ans, length)
print(ans)
*s, = input()

s.append("")

c = 0
ans = 0
for i in range(len(s)):
    if s[i] not in "ACGT":
        ans = max(ans, i - c)
        c = i + 1

print(ans)
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
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:
        if(sum >= max): max = sum
        sum = 0
print(max)
def main():
    s = input()
    l = ['A', 'G', 'T', 'C']
    cnt = 0
    ans = 0
    for j in range(len(s)):
        for i in range(j, len(s)):
            if not s[i] in l:
                ans = max(ans, cnt)
                cnt = 0
                break
            cnt += 1
    print(ans)


if __name__ == '__main__':
    main()
S = input()
n = len(S)
Max = 0
count = 0
for i in range(n):
  if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
    count += 1
  else:
    Max = max(count,Max)
print(Max)
S = input()
ans = 0
temp = 0
for i in range(len(S)):
    if S[i] == 'A' or S[i] == 'C' or S[i] == 'G' or S[i] == 'T':
        temp += 1
    else:
        if ans < temp:
            ans = temp
            temp = 0
        else:
            temp = 0

print(ans)
S = input()
tmp=''
ans=0
for s in S:
  if s in 'ACGT':
    tmp+=s
  else:
    ans = max(ans,len(tmp))
    tmp=''
print(ans)
S = input()
mx = 0
count = 0
for x in S :
    if x in "ATGC" :
        count += 1
    else :
        mx = max(mx, count)
        count = 0
max = max(mx, count)
print(mx)
s = input()

ans = 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
        for j in range(i+1, len(s)):
            if s[j] == 'A' or s[j] == 'C' or s[j] == 'G' or s[j] == 'T':
                count += 1
            else:
                if ans <= count:
                    ans = count
                break

print(ans)
s = str(input())

ans = 0
memo = 0

for i in range(len(s)):
    if s[i] != "A" and s[i] !="C" and s[i] != "G" and s[i] !="T":
        if i-memo > ans:
            ans = i-memo
        memo = i+1
        #print(memo, ans, i)

print(ans)
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)-1):
        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 = input()
t = "ACGT"

ans = 0
cnt = 0
for ss in s:
    if ss in t:
        cnt += 1
    else:
        ans = max(cnt, ans)
        cnt = 0
print(ans)
S=str(input())
ans=0
temp=0
for i in range(len(S)):
    if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T':
        temp+=1
    else:
        ans=max(ans,temp)
        temp=0

print(ans)
s = input()
_s = {"A", "C", "G", "T"}
t = 0
ans = 0
for i in s:
    if i in _s:
        t += 1
    else:
        ans = max(ans, t)
        t = 0
print(ans)
S = input()
ans = 0
for i in range(0,len(S)):
  tmp = S[i]
  if(tmp == "A" or tmp == "G" or tmp == "C" or tmp == "T"):
    ans += 1
  else:
    ans = 0
print(str(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(input())
a=0
b=[0]
for i in range(len(S)-1):
    if S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T':
        b[len(b)-1]+=1
        if (S[i]=='A' or S[i]=='C' or S[i]=='G' or S[i]=='T') and (S[i+1]!='A' and S[i+1]!='C' and S[i+1]!='G' and S[i+1]!='T'):
            b.append(0)
print(max(b))
S = input()
M = 0
con = 0

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

for i,s in enumerate(S):
  if S[i] in L:
    con += 1
  elif S[i] not in L:
    M = max(M,con)
    con = 0

print(M)
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)
S = input()

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

print(ans)
s='A'
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 = 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
if count>record:
    record = count

print(record)
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
            break
print(ans)
s = input()
cnt = 0
ans = 0
for x in s:
    if x in ['A', 'C', 'G', 'T']:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
print(ans)
#ABC122B
S = input()
count_max = 0
count = 0
for i in range(len(S)):
    if "A" in S[i] or "C" in S[i] or"G" in S[i] or"T" in S[i]:
        count += 1
    else:
        if count > count_max:
            count_max = count
print(count_max)
S = input ()
S = S.replace('A', 'a')
S = S.replace('T', 'a')
S = S.replace('C', 'a')
S = S.replace('G', 'a')
ans = 0
x = 0
for i in range (len(S)):
  if S[i] == 'a':
    x += 1
  else:
    if ans < x:
      ans = x
print (ans)
S = input()
L = len(S)
ACGT = ['A', 'C', 'G', 'T']
ans = 0

for i in range(L):
    for j in range(i+1, 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)
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 = ''
        
print(len(output))
S = list(input())

c = 0
ans = 0

for i in S:
    if i=='A' or i=='C' or i=='G' or i=='T':
        c += 1
    else:
        if ans < c:
            ans = c
        c = 0

print(ans)
s = input()
cnt = 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':
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
print(ans)
S = input()
t, m = 0, 0
for s in S:
  if s in ["A", "C", "G", "T"]:
    t += 1
  else:
    m = max(m, t)
    t = 0
print(m)
def main():
    # n = int(input())
    # n, m = map(int, input().split())
    # a = list(map(int, input().split()))
    s = input()
    # h = [int(input()) for _ in rane(n)]
    count = 0
    maxi = 0
    for string in s:
        if string == "A" or string == "C" or string == "G" or string == "T":
            count += 1
        else:
            maxi= max(count, maxi)
            count = 0

    print(maxi)


if __name__ == '__main__':
    main()
S = list(input())
ACGT = ["A", "C", "G", "T"]
count = 0
Max = 0
if len(S) == 1:
    if  S in ACGT:
        print(1)
    else:
        print(0)
else:
    for s in S:
        if s in ACGT:
            count += 1
            if count > Max:
                Max = count
        else:
            if count > Max:
                Max = count
            count = 0
    print(Max)
S=input()
ACGT=[0]
count=0
for i in range(len(S)):
    if (S[i]=="A")|(S[i]=="C")|(S[i]=="G")|(S[i]=="T"):
        count+=1
    else:
        ACGT.append(count)
        count=0
print(max(ACGT))
s = list(input())

acgt = ['A', 'C', 'G', 'T']
c = 0
m = 0
for i in range(len(s)):
    if not s[i] in acgt:
        if m < c:
            m = c
        c = 0
    else:
        c += 1

print(m)
S = input()

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

cnt=0
ans=0
for x in S:
    if x=="A" or x=="C" or x=="G" or x=="T":
        cnt+=1
    else:
        if ans < cnt:
            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 idx in Idxs:
    tmp = S[idx[0]:idx[1]]
    ans = max(ans, ACGT(tmp))
    
print(ans)
s = input()

n = len(s)

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

print(ans)
S = input()

max_len = 0
for i in range(len(S)):
    for j in range(i, len(S)):
        tmp = S[i:j]
        for t in tmp:
            if t != 'A' and t != 'C' and t != 'G' and t != 'T':
                break
        else:
            if len(tmp) >= max_len:
                max_len = len(tmp)

print(max_len)
a = input()
ans = []
count = 0
for i in range(len(a)):

    if a[i] == 'A':
        count +=1
    elif a[i] == 'C':
        count+=1
    elif a[i] == 'G':
        count+=1
    elif a[i] == 'T':
        count+=1
    else:
        ans.append(count)
        count = 0
if len(ans) == 0:
    ans.append(count)
print(max(ans))
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
print(ans)
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()
count = 0
count_max = 0

for k in range(len(s)):
    if s[k] == "A" or s[k] == "C" or s[k] == "G" or s[k] == "T":
        count += 1
    else:
        if count_max < count:
            count_max = count
        else:
            count = 0
print(count_max)
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(1,len(s)-2):
  for j in range(i,len(s)-1):
    if 0 not in s[i:j+1]:
      ans.append(j+1-i)
      
if ans == []:
  print(0)
else:
  print(max(ans))
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
print(ans)
S = input()
cnt = 0
cntmax = 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
        if cnt>cntmax:
            cntmax = cnt

print(cntmax)
s = input()
n = len(s)
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        if all("ACGT".count(c)==1 for c in s[i:j]):
            ans = max(ans,j-i)
print(ans)
# ABC122
# B ATCoder
# ACGT
S =input()
ct = 0
ctM = [0]
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        ct +=1
    else:
        ctM.append(ct)
        ct = 0
print(max(ctM))
a=input()
count=0
s=0
for i in range(len(a)):
    if a[i]=='A' or a[i]=='T' or a[i]=='C' or a[i]=='G':
        count+=1
    else:
        if count>s:
            s=count
        count=0
print(s)
S=list(input())
p=0;q=0
for i in range(len(S)):
  for j in range(i,len(S)):
    if S[j]=="A" or S[j]=="C" or  S[j]=="G" or S[j]=="T":
      q=q+1
      p=max(p,q)
    else:
      q=0
      break
print(p)
S=input()

ans=0

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

ACGT = ['A', 'C', 'G', 'T']
count_list = []
count = 0
if S[0] in ACGT:
    count += 1
for i in range(1, N):
    if S[i] in ACGT:
        count += 1
    else:
        if count > 0:
            count_list.append(count)
            count = 0

if len(count_list) > 0:
    ans = max(count_list)
else:
    ans = 0
    
print(ans)
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    strings = input()
    answers=[]
    counter=0

    for string in strings:
        if "A" in string or "C" in string or "G" in string or "T" in string:
            counter+=1
        else:
            answers.append(counter)
            counter=0
    print(max(answers))
s=input()
import re
ans=re.search("(A|T|G|C)+",s)#matchは文字列先頭のみ、searchは文字列中の位置にかかわらずマッチ。
if ans==None:#noneでエラーが出かねないので事前に排除しておく。
    print(0)
else:
    print(len(ans.group(0)))#何も指定しなければ貪欲マッチで一番長くなるはず。
S = input()
st = set(['A', 'C', 'G', 'T'])
ans, tmp = 0, 0
for s in S:
    if s in st:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0

print(ans)
import re
pattern = re.compile('[ACGT]+')
S = input()
print(re.findall(pattern, S))
print(len(max(re.findall(pattern, S), key=len, default='')))
S=str(input())
S2=[]
ans=0
for i in range(len(S)):
  for j in range(len(S)+1):
    S2=S[i:j]
    print(S2)
    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)
#ABC122B
def main():
    import sys
    S = sys.stdin.readline().rstrip()
    #print(S)
    L = ['A', 'C', 'G', 'T']
    cnt, ans = 0, 0
    for s in S:
        if s in L:
            cnt+=1
        else:
            if ans < cnt:
                ans = cnt
            #print(ans)
            cnt=0
    print(ans)


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

ans = 0
ans_lis = [0]

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

print(max(ans_lis))
s = input()
chrlis = []
for i in range(len(s)):
  if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
    start = i
    for j in range(i,len(s)):
      if s[j]=="A" or s[j]=="C" or s[j]=="G" or s[j]=="T":
        end = j
      else:
        break
  else:
    continue
  chrlis.append(s[start:end+1])

ans = 0
for i in range(len(chrlis)):
  tmp = len(chrlis[i])
  if tmp>ans:
    ans = tmp
print(chrlis,ans)
import sys
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
S = read()
count=0
cnt_max=0
for i in range(len(S)):
  if S[i] in ['A', 'C', 'G', 'T']:
    count +=1
  else:
    cnt_max = max(cnt_max,count)
    count=0
print(cnt_max)
n = list(input())

count = 0

for i in range(len(n)):
  word = 0
  flag = 0
  for j in range(i, len(n)):
    if(flag == 0):
      if(n[j] == 'A' or n[j] == 'C' or n[j] == 'T' or n[j] == 'G'):
        word += 1
        flag = 1
    else:
      if(n[j] != 'A' and n[j] != 'C' and n[j] != 'T' and n[j] != 'G'):
        if(count < word):
          count = word
          word = 0
        flag = 0
      else:
        word += 1

print(count)
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()

ans = 0
cnt = 0
for i in s:
    if i in 'ATCG':
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0
print(ans)
S = input()

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

print(ans)
s = input()
ans1 = 0
ans2 = 0

for a in s:
  if a == "A" or a == "T" or a == "C" or a == "G":
    ans2 += 1
  else:
    if ans1 < ans2:
      ans1 = ans2
      ans2 = 0
    else:
      ans2 = 0
print(ans1)
S = input()

cnt = 0
max_cnt = 0

for i in S:
  if i == "A" or "C" or "G" or "T":
    cnt +=1
    if cnt > max_cnt:
      max_cnt = cnt
  else:
    cnt = 0
    
print(max_cnt)
s = list(input())
t = ["A", "C", "G", "T"]
c, m = 0, 0
for i in s:
    if i in t:
        c += 1
    else:
        if m < c:
            m = c
        c = 0
print(m)
S = input()
ma = 0
ma_ = 0
for c in S:
    if c == 'A' or c == 'C' or c == 'G' or c == 'T':
        ma_ += 1
    else:
        ma = max(ma, ma_)
        ma_ = 0

print(ma)
#python3

def main():
    s = input()
    n = len(s)
    ans = 0
    cnt = 0 
    for i in range(n-1):
        if not ((s[i] == 'A') or (s[i] == 'T') or (s[i] == 'C') or (s[i] == 'G')):
            cnt = 0
        else:
            cnt += 1
        ans = max(cnt, ans)
    print(ans)
main()
S = input()

ACGT = 'A C G T'.split()
result = 0
tmp = 0
for i in S:
    if i in ACGT:
        tmp += 1
    else:
        if tmp > result:
            result = tmp
        tmp = 0

print(result)
s = input()

ans = 0

for l in range (len(s)-1):

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

    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)