You are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.
Here, a ACGT string is a string that contains no characters other than A, C, G and T.

-----Notes-----
A substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.
For example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and  (the empty string), but not AC.

-----Constraints-----
 - S is a string of length between 1 and 10 (inclusive).
 - Each character in S is an uppercase English letter.

-----Input-----
Input is given from Standard Input in the following format:
S

-----Output-----
Print the length of the longest ACGT string that is a substring of S.

-----Sample Input-----
ATCODER

-----Sample Output-----
3

Among the ACGT strings that are substrings of ATCODER, the longest one is ATC.

Difficulty: introductory

Starter code:

Solutions:
a = input()

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

result =[]
res= 0
for i in a:
    if i in atcg:
        res +=1
    else:
        res = 0
    result.append(res)

print(max(result))

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

s = input()
ans = 0
length = 0

for c in s:
    if c in {'A', 'C', 'G', 'T'}:
        length += 1
    else:
        length = 0

    ans = max(length, ans)

print(ans)


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))

str_list = list(input())

count = 0
max_count = 0
for char in str_list:
	if char == 'A' or char == 'C' or char == 'G' or char == 'T':
		count += 1
	else:
		if count > max_count:
			max_count = count
		count = 0
if count > max_count:
	max_count = count
print(max_count)

s = input()
data = ['A','T','G','C']
ans = 0
for i in range(len(s)):
    for j in range(i,len(s)):
        if s[j] not in data:
            ans = max(ans,j-i)
            break
        elif j == len(s) - 1:
            ans = max(ans,len(s) - i)
print(ans)

def judge(c):
	if c=='A' or c=='G' or c == 'C' or c == 'T':
		return True
	else:
		return False

s = input()

ans = 0

for i in range(0,len(s)):
	for j in range(i+1,len(s)+1):
		ok = True
		for k in range(i,j):
			#print(i,j,k)
			if not judge(s[k]):
				ok = False
		if ok:
			ans = max(ans,j-i)

print(ans)

import re
s = input()
res = re.findall(r'[ATGC]+',s)
ans = 0

for e in res:
  ans = max(ans,len(e))
  
print(ans)

str1 = input()
table = list(str1)
count = 0
ans = 0
for i in range(len(str1)):
    if table[i] == 'A' or table[i] =='T' or table[i] =='C' or table[i] == 'G':
        count += 1
        if ans < count:
            ans = count
    else:
        count = 0
print(ans)

S = input()

# Sの部分文字列は、空文字列以外に N+(N−1)+(N−2)+...+1 = N(N+1)/2 個存在する
# 今回は N<=10 であり、この個数は最大で 10(10+1)/2 = 55 なので間に合う
# 全て調べて、最も長い「ACGT文字列」の長さを求める
# ここで「ACGT 文字列」は、A,C,G,Tのいずれかから成る文字列

N = len(S)
ans = 0
for i in range(N):
  for j in range(i, N):
    T = list(S[i:j+1])
    M = j-i+1
	# ACGT文字列かどうかの判定
    flag = True
    for k in range(M):
      if T[k] != 'A' and T[k] != 'C' and T[k] != 'G' and T[k] != 'T':
        flag = False
        break
    # ACGT文字列なら長さを更新
    if flag: ans = max(ans, M)
      
print(ans)

S=input()
count=0
def rec(n):
    if n >= len(S): return 0
    if S[n] in 'ACGT': return rec(n+1) + 1
    else: return 0
for i in range(len(S)):
    c=rec(i)
    count = max(count, c)
print(count)

s = input()

res = 0
c = 0
for i in range(len(s)):
  if s[i] == "A" or s[i] == "G" or s[i] == "C" or s[i] == "T":
    c += 1
  else:
    res = max(res,c)
    c = 0
res = max(res,c)
print(res)

S=input()
d=["A","T","C","G"]
l=len(S)
 
acgt = []
a = ""
 
for i in range(l):
	if S[i] in d:
		a = a + S[i]
		if i == l-1:
			acgt.append(a)
	else:
		acgt.append(a)
		a = ""

max = 0
for a in acgt:
	if len(a) > max:
		max = len(a)
 
print(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
    x = 0
if ans < x:
  ans = x
print (ans)

S = input()
S += '*'
st = 'ACGT'
i, n = 0, len(S)
max_len = 0
while i < n:
    j = i
    size = 0
    while S[j] in st:
        size += 1
        j += 1
    i = j+1
    max_len = max(max_len, size)
print(max_len)

s=input()
tmp, ans = 0, 0
for i in s:
  if i in {'A', 'C', 'G', 'T'}: 
    tmp += 1
  else:
    tmp = 0
  ans = max(ans, tmp)
print(ans)

S = str(input())
count = 0
data = []


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

data.append(count)

print(max(data))

s = input()
count = 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:    
        tmp = 0
    count = max(tmp,count)
print(count)

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

S=input()

cnt = 0
ans = 0
for x in S:
  if x in ["A","C","G","T"]:
    cnt += 1
    ans = max(cnt, ans)
  else:
    cnt = 0
print(ans)

# B - ATCoder
S = list(input())

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

s = input()
char = "ACGT"
now = 0
ans = 0

for i in s:
    if i in char:
        now += 1
    else:
        now = 0
    ans = max(ans, now)
print(ans)


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


S = input()
max_ = 0

for i in range(len(S)):
    for j in range(i,len(S)):
        if all("ACGT".count(c) == 1 for c in S[i:j+1]):
            max_ = max(j+1-i,max_)
print(max_)


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

s=list(input())
#print(s)
rmax=0
r=0
for ss in s:
  if ss in ["A","C","G","T"]:
    r+=1
  else:
    rmax=max(rmax,r)
    r=0
rmax=max(rmax,r)
print(rmax)

s = input()

count = 0
ans = 0

for i in s:
    if i in {'A', 'T', 'C', 'G'}:
        count += 1
    else:
        count = 0
    ans = max(ans, count)

print(ans)

S=input()
count=0
def rec(n):
    if n >= len(S): return 0
    if S[n] == 'A' or S[n] == 'C' or S[n] == 'G' or S[n] == 'T': return rec(n+1) + 1
    else: return 0
for i in range(len(S)):
    c=rec(i)
    count = max(count, c)
print(count)

X = ["A","C", "G", "T"]
S = input()
sum = 0
ans = 0
for i in S:
    if i in X:
        sum += 1
    else:
        sum = 0
    ans = max(sum, ans)
print(ans)

S = input()
cnt = 0
maxv = 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
        if cnt > maxv:
            maxv = cnt
    else:
        cnt = 0
print(maxv)


s = input()
ls = len(s)

cnt = 0
ma = 0
for i in range(ls):
    if(s[i] in 'ACGT'):
        cnt += 1
    else:
        ma=max(ma,cnt)
        cnt = 0

ma = max(ma,cnt)
print(ma)

S = input()
l = len(S)
answer = 0
for i in range(l):
  for j in reversed(range(i+1,l+1)):
    T = S[i:j]
    T_1 = T.replace('A', '').replace('C', '').replace('G', '').replace('T', '')
    if len(T_1) == 0:
      pri = j-i
      if pri > answer:
        answer = pri
print(answer)

S = input()

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

ans = 0
N = len(S)
for i in range(N):
  for j in range(i+1, N+1):
    T = list(S[i:j])
    M = len(T)

    flag = True
    for k in range(M):
      if T[k] != 'A' and T[k] != 'C' and T[k] != 'G' and T[k] != 'T':
        flag = False
        break
    if flag: ans = max(ans, M)
      
print(ans)

S = input()

lst = ['A', 'C', 'G',  'T']
count = 0
top = 0

for i in S:
    if i in lst:
        count += 1
    else:
        if count > top:
            top = count
        count = 0
if count > top:
    top = count
print(top)

import itertools
S = input()
ans = 0
for i,j in itertools.combinations(list(range(len(S)+1)), 2):
    if all('ACTG'.count(c)==1 for c in S[i:j]):
        ans = max(ans, len(S[i:j]))
print(ans)


remove = ['A', 'C', 'G', 'T']
s = input()
cnt = [0]*10
j = 0
for i in range(len(s)):
    if s[i] in remove:
        cnt[j] += 1
    else:
        j += 1   

print(max(cnt))

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

s = input() + 'I'
List = []

for i in range(len(s)):
    count = 0
    for j in range(len(s) - i):
        if s[i] == 'A' or s[i] == 'T' or s[i] == 'G' or s[i] == 'C':
            count += 1
            i += 1
        else:
            List.append(count)
            break

print(max(List))

S = input()
T = []

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

point = [0]*(len(S)+1)

for i in range(len(S)):
    if T[i] == 0:
        point[i+1]=point[i]+1
    else:
        point[i+1]=0

print((max(point)))


s = list(input())
n = len(s)
ans = 0

for i in range(n):
    if s[i] in ['A', 'G', 'C', 'T']:
        s[i] = 'a'

for i in range(n):
    for j in range(i, n):
        flag = True
        for k in range(i, j+1):
            if s[k] != 'a':
                flag = False
        if flag:
            ans = max([ans, j-i+1])

print(ans)

S = str(input())
N = len(S)

count = 0 

saidai = 0

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

for i in range (0, N):
	if vernon.count(S[i]) > 0:
		count+=1
	else:
		saidai = max(saidai, count)
		count = 0
        
saidai = max(saidai, count)
print(saidai)

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


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:
        c = 0
    ans.append(c)

print(max(ans))

s=input()
ans=0
for i in range(len(s)):
  for j in range(i,len(s)):
    if all("ACGT".count(c)==1 for c in s[i:j+1]):
      ans=max(ans,j-i+1)
print(ans)

# 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
        if i == len(S)-1:
            ctM.append(ct)
    else:
        ctM.append(ct)
        ct = 0
print((max(ctM)))


s = input()
score=0
ans=0
for i in s:
  if i in {"A", "T", "C", "G"}:
    score+=1
  else:
    score=0
  ans=max(score,ans)
print(ans)


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

S = input()

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

res = max(res, cnt)

print(res)

s=input()
tmp, ans = 0, 0
for i in range(len(s)):
  for j in range(i, len(s)):
    if all('AGCT'.count(h) == 1 for h in s[i:j +1]):
      ans = max(ans, j -i +1)
print(ans)

s = input()

ans = []

x = 0

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

ans.append(x)

print((max(ans)))


s = list(input())
n = len(s)
res = 0
for i in range(n):
    for j in range(i,n):
        temp = s[i:j+1]
        if all(i in 'ATGC' for i in temp):
            res = max(res,len(temp))
print(res)

s = input()

acgt = ['A','C','G','T']
i = 0
max_ans = 0
curr_ans = 0

while(i < len(s)):
    if s[i] in acgt:
        curr_ans += 1
    else:
        max_ans = max(max_ans, curr_ans)
        curr_ans = 0
    i += 1
max_ans = max(max_ans, curr_ans)
print(max_ans)

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


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:
    c = 0
  ans.append(c)

print(max(ans))

S = input()
L = len(S)
ans = 0
for i in range(L):
    c = 0
    for s in S[i:]:
        if s in ['A', 'C', 'G', 'T']:
            c += 1
        else:
            break
    ans = max(ans, c)

print(ans)

text = input()

count = 0
max_count = 0
for i in range(len(text)):
    if text[i] == "A" or text[i] == "C" or text[i] == "G" or text[i] == "T":
        count += 1;
    else:
        if max_count < count:
            max_count = count
            count = 0
        else:
            count = 0
            
print(max(max_count,count))

S = input()

N = len(S)
ans = 0
# Sの部分文字列は、空文字列以外に N+(N−1)+(N−2)+...+1 = N(N+1)/2 個存在する
# 今回は N<=10 であり、この個数は最大で 10(10+1)/2 = 55 なので間に合う
# 全て調べて、最も長い「ACGT文字列」の長さを求める
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()) + ["X"]

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

for i in range(len(s)):
    if s[i] in l:
        s[i] = 1
    else:
        s[i] = 0

cnt = 0
li = []
for i in range(len(s)):
    if s[i] == 1:
        cnt +=1
    else:
        li.append(cnt)
        cnt = 0

print(max(li))

S = input()

s_len = len(S)
ACGT = {"A", "C", "G", "T"}
max_len = 0
max_str = ''
str = ''

for i in range(s_len):
  str = ''
  for j in range(i, s_len):
    if S[j] in ACGT:
      str += S[j]
      if len(str) >= max_len:
        max_len = len(str)
        max_str = str
    else:
      str = ''


print(max_len)


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

def main():
    S = str(input())

    max_cnt = 0
    cnt = 0
    for s in S:
        if s in target_a:
            cnt += 1
        else:
            if cnt > max_cnt:
                max_cnt = cnt
            cnt = 0
    if cnt > max_cnt:
        max_cnt = cnt
    print(max_cnt)

def __starting_point():
    main()
__starting_point()

s = input()
maxlen = 0
for i in range(len(s)):
    for j in range(1,len(s)+1):
        t = s[i:j]
        if all([c in 'ACGT' for c in s[i:j]]):
            maxlen = max(maxlen, j-i)
print(maxlen)

a = input()
 
atcg =["A","T","C","G"]
 
result =[]
res= 0
for i in a:
    if i in atcg:
        res +=1
    else:
        res = 0
    result.append(res)
 
print(max(result))

moji = str(input())
ans = 0
cans = 0
correct = ["A","C","G","T"]
for i in range(len(moji)):
    if moji[i] in correct:
        cans += 1
        if cans > ans:
            ans = cans
    else:
        if cans > ans:
            ans = cans
        cans = 0
print(ans)


S = input()
cnt = 0
res = 0
for s in S:
    if s in "AGCT":
       cnt += 1
       res = max(res,cnt)
    else:
        cnt = 0
print(res)


s=input()
ans=0
tmp=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":
            tmp+=1
        else:
            ans=max(ans,tmp)
            tmp=0
            break
    else:
        ans=max(ans,tmp)
        tmp=0
print(ans)

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

S=str(input())
le=len(S)
cnt=0
Ans=0

for i in range(le):
  if S[i] in 'A' or S[i] in 'C' or \
  S[i] in 'G' or S[i] in 'T':
    cnt+=1
    if Ans<cnt:
      Ans=cnt
  else:
    cnt=0

print(Ans)


import sys
input = sys.stdin.readline

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

def __starting_point():
    slove()
__starting_point()

import re
S = input()
r = re.findall('[ACTG]+', S)
print(max([len(_) for _ in r], default=0))

S = input()
length = 0
for i in range(0, len(S)+1):
    for j in range(i, len(S)+1):
        T = S[i:j]
        if T.replace('A', '').replace('C', '').replace('G', '').replace('T', '') == '':
            if len(T) > length:
                length = len(T)
print(length)

n=str(input())

pattern = 'ACGT'
r, tmp = 0, 0
c = False
for s in n:
	if s in pattern:
		tmp += 1
	else:
		if r < tmp:
			r = tmp
		tmp = 0
if r < tmp:
  r = tmp
print(r)

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

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

s = input()
S = ""
for i in s:
    if i in "ACGT":S+="1"
    else:S+="0"
print(max(list(map(len,S.split("0")))))

s = input()
l = len(s)
max_l = 0
count = 0
lst = ['A', 'C', 'G', 'T']
for i in range(l):
  if s[i] in lst:
    count += 1
    if count > max_l:
      max_l = count
  else:
    count = 0
print(max_l)


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

count = 0
max = 0
for i in S:
	if i in acgt:
		count += 1
	else:
		if count > max:
			max = count
			count = 0
if count > max:
	max = count
	count = 0

print(max)


S=input()
agct='AGCT'
ans=0
s=0
for i in range(len(S)):
  cnt=0
  if S[i] in agct:
    j=0
    while i+j<len(S) and S[i+j] in agct:
      cnt+=1
      j+=1
    ans=max(ans,cnt)
print(ans)

S = str(input())
ans = 0

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

print(ans)

s = input()
a, l = 0, 0
for i in s:
  if i in "ATGC":
    l += 1
  else:
    l = 0
  a = max(a, l)
print(a)

s = input()

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

S=input()
ACGT=["A","C","G","T"]
ans=0
cnt=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)

s = input()
l = len(s)
cnt = 0
ans = 0

for i in range(l):
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
        cnt += 1
        if ans < cnt:
            ans = cnt
    else:
        cnt = 0

print(ans)

S = input()
 
N = len(S)
ans = 0
for i in range(N):
  for j in range(i, N):
    T = list(S[i:j+1])
    M = len(T)
 
    flag = True
    for k in range(M):
      if T[k] != 'A' and T[k] != 'C' and T[k] != 'G' and T[k] != 'T':
        flag = False
        break
    if flag: ans = max(ans, M)
      
print(ans)


S = input()

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

print(ans)

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

# Sの部分文字列は、空文字列以外に N+(N−1)+(N−2)+...+1 = N(N+1)/2 個存在する
# 今回は N<=10 であり、この個数は最大で 10(10+1)/2 = 55 なので間に合う
# 全て調べて、最も長い「ACGT文字列」の長さを求める
# ここで「ACGT 文字列」は、A,C,G,Tのいずれかから成る文字列

'''
s = 'aAaAAbAccdd' # 'A'という文字が何個あるか調べる
s.count('A') # 4
'''

for i in range(N):
  for j in range(i, N):
    # 'ACGT'.count(c) == 1 -> 文字cがA,C,G,Tのいずれかであるとき:True / otherwise: False
    # all() -> 引数に指定したListの要素がすべてTrue => True / otherwise: False
    if all(['ACGT'.count(c) == 1 for c in S[i:j+1]]): ans = max(ans, j-i+1)
      
print(ans)

s = input()

mx = 0
cnt = 0

for (i, char) in enumerate(s):
    if char in "ACGT":
        cnt += 1
    else:
        mx = max(mx, cnt)
        cnt = 0

mx = max(cnt, mx)

print(mx)


S = input()

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

print(ans)

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

s = input()
cnt = [0]*len(s)

for i in range(len(s)):
    for j in range(i, len(s)):
        if s[j] in L:
            cnt[i] += 1
        else:
            break
print((max(cnt)))


s=input()

tmp=0
length=[]

for i in range(len(s)):
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        tmp+=1
        if i==len(s)-1:
            length.append(tmp)
    else:
        length.append(tmp)
        tmp=0
print(max(length))

# -*- coding:utf-8 -*-
import re
S = input()
S_sp = re.split("[^ACGT]",S)
ans = 0
for moji in S_sp:
    if len(moji) > ans:
        ans = len(moji) 

print(ans)


S=input()
S=list(S)
for i in range(len(S)):
  s=S[i]
  if (s=="A")|(s=="T")|(s=="C")|(s=="G"):
    S[i]=0
  else:
    S[i]=1


point=[0]*(len(S)+1)
for i in range(0,len(S)):
  if S[i]==0:
    point[i+1]=point[i]+1
  else:
    point[i+1]=0

print(max(point))

S = str(input())

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

import re


def answer(s: str) -> int:
    pattern = r'[ACTG]+'
    result = re.findall(pattern, s)
    if not result:
        return 0
      
    return len(max(result, key=len))


def main():
    s = input()
    print((answer(s)))


def __starting_point():
    main()

__starting_point()

S = input()

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


S = list(input())
temp = 0
ans = 0
letter = ["A", "T", "C", "G"]
for i, val in enumerate(S):
  if val in letter:
    temp += 1
  else:
    if ans < temp:
      ans = temp
    temp = 0
if ans < temp:
  ans = temp
print(ans)
      



S=input()
ans=0
acgt=['A','C','G','T']
for i in range(len(S)):
    if S[i] in acgt:
        cnt=0
        j=i
        while j <len(S) and S[j] in acgt :
            cnt+=1
            j+=1
        ans=max(ans,cnt)

print(ans)


items = ['A', 'C', 'G', 'T']
 
def max(a, b):
    return a if a > b else b
x= 0
y = 0
for c in list(input()):
    if c in items:
 
        y += 1
        x = max(x, y)
    else:
        y = 0
print(x)

s = input()
a = ""
b = 0
for i in s:
  if i in "ACGT":
    a += i
    if b < len(a):
      b = len(a)
  else:
    a = ""
print(b)