peterverebics/CodeNet_Python_118 huggingface dataset:
S = input()
count = 0
koremade = 0
for i in range(0,len(S)):
    if S[i] in 'ACGT':
        count += 1
    else:
        if koremade <= count:
            koremade = count
        count = 0
print(koremade)
S = input()
ans = 0
i = 0
while i<len(S):
    j = 0
    if (S[i+j]=='A' or S[i+j]=='G' or S[i+j]=='T' or S[i+j]=='C'):
        while i+j<len(S) and (S[i+j]=='A' or S[i+j]=='G' or S[i+j]=='T' or S[i+j]=='C'): 
            j +=1
        if j >= ans:
            ans = j
        i = i+j     
    else:
        i += i+1
print(ans)
# print(S)
s = str(input())

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

score = 0
tmp = 0
for i in s:
  if(i in list):
    tmp += 1
  else:
    score = max(score,tmp)
    tmp = 0

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

maxc = 0
c = 0

for i in range(N):
    if S[i] in {'A', 'T', 'G', 'C'}:
        c += 1
    else:
        maxc = max(maxc, c)
        c = 0

print(maxc)
S = input()

l = []

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

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

ans = 0
for i in range(len(s)):
    for j in range(i,len(s)):
        tmp = s[i:j]
        if set(list(tmp)) <= set(["A","C","G","T"]):
            ans = max(ans,len(tmp))
print(ans)
S = input()
ACGT = ['A','C','G','T']
max_length = 0
for i in range(len(S)):
    j = i
    while len(S) > j+1 and S[j] in ACGT:
        j += 1
    if max_length < j - i:
        max_length = j - i
print(max_length)
s = input()
n = len(s)
ans = 0
count = 0

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


print(ans)
S = input()

L = []
for i in range(len(S)):
    if(S[i] in 'ACGT'):
        count = 1
    else:
        continue
    for j in range(i + 1, len(S)):
        if (S[j] in 'ACGT'):
            count += 1
        else:
            L.append(count)
            break

if (len(L) == 0):
    print('0')
else:
    print(max(L))
s = input()
longest = 0

n_max = 0
for i, x in enumerate(s):
  if x in ["A", "C", "G", "T"]:
    n_max += 1
  else:
    longest = max(longest, n_max)
    n_max = 0
    
print(longest)
S = input()

max = 0
for i in range(len(S)-1):
    for j in range(i+1, len(S)):
        count = 0
        for char in S[i:j]:
            if char == 'A' or char == 'C' or char == 'G' or char == 'T':
                count += 1
        if count > max:
            max = count

print(max)
S = input()

num = 0
count = 0
lis = ["A", "G", "C", "T"]
for s in S:
  if s in lis:
  	count += 1
  else:
    if num < count:
      num = count
    count = 0
print(num)
import sys
input = sys.stdin.readline

S = input().strip()
a = ['A', 'T', 'G', 'C']

ans = 0
j = []
for i in range(len(S)):
  j = i
  count = 0
  while True:
    if j >= len(S):
      break
    if S[j] in a:
      count += 1
      j += 1
    else:
      ans = max(ans, count)
      break
  
print(ans)
def judacgt(c):
    return c=="A" or c=="G" or c=="C" or c=="T"


s = input()

max = 0

for i in range(len(s)):
    if judacgt(s[i]):
        for j in range(i+1,len(s)):
            # print(s[i:j])
            if judacgt(s[j])==False:
                break
            elif j-i+1 > max:
                max=j-i+1
print(max)
S = input()
count = 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":
        count += 1
    else:
        if max < count:
            max = count
        count = 0
print(max)
s = input()

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

ans = 0
ans_max = 0
flg = False
for c in s:
    if c in ACGT:
        ans += 1
        flg = True
    elif flg:
        ans_max = max(ans_max, ans)
        ans = 0
        flg = False

print(ans_max)
S = input()
n = len(S)
ans = 0
list = ['A', 'G', 'C', 'T']
for i in range(n):
    j = i
    while j < n:
        if S[j] in list:
            j += 1
        else:
            if ans < j - i :
                ans = j - i
            break
print(ans)
s = input()
len_li = [0]
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:
        len_li.append(cnt)
        cnt = 0 
print(max(len_li))
s = input()

acgt = set("ACGT")

ans = 0

for i in range(len(s)):
    for j in range(i, len(s)):
        if acgt >= set(s[i:j]):
            ans = max(ans, j-i)

print(ans)
s = input()
n = len(s)
ans = 0
for i in range(n):
    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)
a=input()
total=0
total2=0
i=0
while True:
    if i==len(a)-1:
        break
    elif a[i]=="A" or a[i]=="T" or a[i]=="C" or a[i]=="G":
        total+=1
        i+=1
    else:
        i+=1
        if total2<total:
            total2=total
        total=0
print(total2)
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
            
print(max_chain)
s=input()
S=[s[i] for i in range(len(s))]
A={'A','C','G','T'}
B=[S[i] in A for i in range(len(S))]
max_length=0
print(B)
for i in range(len(B)):
  if B[i]==1:
    count_length=1
    count=i
    max_length=max(count_length,max_length)
    while (count+1)<len(B) and B[count+1]==1:
      count_length=1+count_length
      count=1+count
      max_length=max(max_length,count_length)
      
print(max_length)
s = input()
pre = False
ans = ''
m = 0
for i in s:
  if i==s[0] and i in 'ACGT':
    ans+=i
    pre=True
    continue
  if i in 'ACGT' and pre == True:
    ans+=i
    pre=True
  else:
    pre=False
    m = max(m, len(ans))
    ans=''
print(len(ans))
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(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
    #最長のACGT文字列が、文字列の末尾にあるときに対応する
    if i == len(S) and count>count_max:
        count_max = count
    #まだ列が途中であって、文字が途切れた時、maxを更新する
    else:
        if count > count_max:
            count_max = count
print(count_max)
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
if len(num_list)==0:print(0)
else:
    print(max(num_list))
s=input()

ans=0
memory=0

for i in range(len(s)):
    if s[i]=="A" or s[i]=="T" or s[i]=="G" or s[i]=="C":
        memory+=1
    else:
        ans=max(ans,memory)
        memory=0
        
print(ans)
import random
b = input()
if b =="A":
    print("T")
elif b=="T":
    print("A")
elif b=="G":
    print("C")
elif b=="C":
    print("G")
S = input()
RES = 0

def countACGT(s):
  res = 0
  res += s.count("A")
  res += s.count("C")
  res += s.count("G")
  res += s.count("T")
  return res

for i in range(len(S)):
  for j in range(len(S)):
    RES = max(RES,countACGT(S[i:j]))
print(RES)
S = input()
N = len(S)

ans = 0
for i in range(N):
	for j in range(i+1,N):
		if all("ACGT".count(c) == 1 for c in S[i:j+1]):
			ans = max(len(S[i:j+1]), ans)
print(ans)
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()
count = 0
res = 0
for i in S:
    if i in ["A", "C", "G", "T"]:
        count += 1
    else:
        res = max(count, res)
        count = 0
print(res)
S = input()
counter = 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"):
        counter += 1
    else:
        max_ = max(max_,counter) 
        counter = 0
print(max_)
s = input()
ans = 0
for i in range(len(s)):
    count = 0
    for j in range(len(s)):
        if s[j] in "ACGT":
            count += 1
        else:
            break
    if count >= ans:
        ans = count
print(ans)
s = str(input())
s += "B"
l = len(s)
c = 0
mx = 0
for i in range(l):
  if s[i] in ["A","G","C","T"]:
    c += 1
  else:
    if c > mx:
      mx = c
      c = 0
    else:
      c = 0
s=input()
l=list("ACGT")
ans=0
for i in range(len(s)):
    for k in range(i+1,len(s)):
        if all(i in l for i in s[i:k]):
            ans=max(ans,len(s[i:k]))
print(ans)
s=str(input())
s=list(s)
l=len(s)
ans=0
temp=0
for i in range(0,l):
  if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
    temp=temp+1
  else:
    ans=max(ans,temp)
    temp=0
print(ans)
s = input()
ans = 0
for l in range(len(s) - 1):
    for r in range(l+1, len(s)):
        if set(s[l:r]).issubset({"A", "T", "C", "G"}):
            ans = max(ans, len(s[l:r]))
print(ans)
s = input()
cnt = 0
max_cnt = 0
for i in s:
    if i in ['A', 'T', 'C', 'G']:
        cnt += 1
    else:
        cnt = 0
    max_cnt = max(max_cnt, cnt)
print(cnt)
words = input()

lst = ['A', 'C', 'G', 'T']
max_count = 0
count = 0
for i in range(len(words)):
  if words[i] in lst:
    count += 1
  else:
    if count > max_count:
      max_count = count
    count = 0
print(max_count)
S = list(input())
M = 0
count = 0
for x in S:
  if x =="A" or x =="C" or x =="T" or x =="G":
    count += 1
  else:
    if M<count:
      M = count
    count = 0
print(M)
S = list(input())
N = len(S)
M = ["A","G" ,"C" ,"T"]

cnt = 0
Ans = 0
for i in range(N):
    if S[i] in M:
        cnt += 1
        Ans = max(Ans, cnt)
    else:
        Ans = max(Ans, cnt)
print(Ans)
s = input()
import itertools
def judge(k):
    if s[k] == "A" or s[k] == "C" or s[k] == "G" or s[k] == "T":
        return True
    return False

ans = 0
for comb in itertools.combinations(range(len(s)),2):
    i,j = comb
    true = 1
    for k in range(i,j+1):
        if not judge(k):
            true = 0
            break
    if true == 1:
        ans = max(ans,j-i+1)
print(ans)
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)
    count = 0
print(Max)
# 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]-1,M)
print(M)
S = input()
F = "ATGC"
cnt = 0
for i in S:
  if i in F:
    cnt += 1
print(cnt)
S = input()
max = 0
ans = 0

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

print(max)
S = input()
T = set(list('AGCT'))

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

print(ans)
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
print(result)
S=list(input())
line=[]
A=["A","C","G","T"]
flag=False
for s in S:
    if s in A:
        line.append(s)
        flag=True
    elif flag:break
print(len(line))
s=input()
count=0
ans=0
for i in range(len(s)):
    if s[i]=="A" or s[i]=="G" or s[i]=="C" or s[i]=="T":
        count+=1
    else:
        ans=max(ans,count)
        count=0
print(ans,count)
def main():
    S = input()
    candidates = ("A", "C", "G", "T")
    ans = 0
    tmp = 0
    for s in S:
        if s in candidates:
            tmp += 1
        else:
            ans = max(ans, tmp)
            tmp = 0
 
    print(ans)
 
    return
 
 
if __name__ == "__main__":
    main()
S = input()
n = len(S)
head, tail, max = 0, 0, 0
list = ['A', 'G', 'C', 'T']
while tail < n and head < n:
    if S[head] in list:
        head += 1
    else:
        if max < (head - tail):
            max = head - tail
        tail = head + 1
        head += 1
print(max)
s = input()

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

ans = 0
temp = 0
for c in s:
    if c in acgt_list:
        temp += 1
        continue
    
    if temp > ans:
        ans = temp
    temp = 0
print(ans)
T = input()
word = ['A','C','G','T']
result = []
target_result = []
count = 0
for i in T:
  if i in word:
    result.append(i)
    count += 1
  else:
    if count == 0:
      continue
    target = ''.join(result)
    reuslt = []
    target_result.append(target)
    count = 0
print(len(max(target_result)) if target_result else 0)
def main():
    S = input()
    ans = 0
    cnt = 0

    for ch in S:
        if ch == "A":
            cnt += 1
        elif ch == "C":
            cnt += 1
        elif ch == "G":
            cnt += 1
        elif ch == "T":
            cnt += 1
        elif cnt > ans:
            ans = cnt

    print(ans)


if __name__ == "__main__":
    main()
def main():
    s = str(input())
    count = 0
    count_lst = [0]
    flag = False

    for i in range(len(s)):
        letter = s[i]
        string = 'ACGT'

        if letter in string:
            count += 1
            flag = True

        else:
            if flag:
                count_lst.append(count)
            count = 0
            flag = False

    longest = max(count_lst)
    print(longest)


if __name__ == '__main__':
    main()
S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j]
    if s.strip("ACGT") == "":
      l.append(s)

m = sorted(l, key=len)
print(m[-1])
S = input()
ans = 0
streak = 0
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        streak += 1
    else:
        if ans < streak:
            ans = streak
        streak = 0
print(ans)
import string
str_up = string.ascii_uppercase.replace("A","").replace("C","").replace("G","").replace("T","")
S = input()
part = []
for i in range(len(S)):
    for j in range(len(S)-i):
        part.append(S[i:j])
max_s = 0
for i in part:
    for j in str_up:
        if j in i:
            break
        elif j == "Z":
            if len(i) > max_s:
                max_s = len(i)
print(max_s)
l=input()

ans=0
num=0

for i in l:
  if i=="A" or i=="G" or i=="C" or i=="T":
    num+=1
  else:
    ans=max(num,ans)
    num=0
    
print(ans)
l = ['A','T','C','G']
s = ''
tmp =''
st = input()
for i in st:
    if i in l:
        s+=i
        if i == st[len(st)-1] and len(s) > len(tmp):
            tmp = s
            s =''
    else:
        if len(s) > len(tmp):
            tmp = s
            s =''
print(len(tmp))
l=input()

if "A" or "G" or "C" or "T" in l:
  ans=0
  num=0
  for i in l:
    if i=="A" or i=="G" or i=="C" or i=="T":
      num+=1
    else:
      ans=max(num,ans)
      num=0
    
  print(ans)
else:
  print(0)
s=input()
cnt=0
ans=0
lit=["A","C","G","T"]
for i in range(len(s)):
  if s[i] in lit:
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
print(ans)
S = input()
m = 0
c = 0
for s in S:
    if s in ["A", "C", "G", "T"]:
        c += 1
    else:
        m = max(m, c)
        c = 0
print(m)
s = input()
ans = 0
count = 0

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

print(ans)
s = input()
ans = 0
for c in s:
    if c in ('A', 'C', 'G', 'T'):
        ans += 1
print(ans)
S = input()
n = len(S)
ans = 0
k = 0
agct = ['A','G','C','T']
for i in range(n):
    if S[i] in agct:
        k+=1
        continue
    ans = max(k,ans)
    k = 0

print(ans)
s=input()
a,b=0,0
for i in range(len(s)):
    if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":
        a+=1
    else:
        b=max(a,b)
        a=0
print(b)
s = input()
list_s = ["A","C","T","G"]
ans = []
count=0
for i in range(-1,len(s)-1):
    #List.append(s[i])
    #print(s[i])
    #print(s[i+1])
    if s[i] in list_s and s[i+1] in list_s:
        count+=1


if count>0:
    print(count+1)
else:
    print(0)
S = input()
ACGT = ['A', 'C', 'G', 'T']
ans = [0] * len(S)

for i in range(len(S)):
    if S[i] in ACGT:
        cnt = 1
        for j in range(len(S) - i - 1):
            if S[i+j+1] in ACGT:
                cnt += 1
            else:
                ans[i] = cnt
                break

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

if __name__ == '__main__':
    resolve()
s=input()
print(s.count('A')+s.count('T')+s.count('G')+s.count('C'))
s = input()

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

ans = 0
for i in s:
    if i in t:
        ans +=1 
print(ans)
S=input()
L=['A','C','G','T']
no=0
x=0
for i in S:
  if i in L:
    x+=1
  else:
    x=0
  ans=max(x,no)
print(ans)
S = input()

ans = 0
for i in range(len(S)):
    for j in range(i + 1, len(S)):
        sub_s = S[i:j]
        is_acgt = True
        for s in sub_s:
            if s == "A" or s == "C" or s == "G" or s == "T":
                continue
            else:
                is_acgt = False
        if is_acgt:
            ans = max(ans, len(sub_s))

print(ans)
s=input()
ans=0
tmp=0
l=['A','C','G','T']

for i in range(len(s)):
    if l.count(s[i]) != 0:
        tmp+=1
    else:
        ans=max(tmp,ans)
        tmp=0
print(ans)
S = input()
N = len(S)
ACGT = []
others = 'BDEFHIJKLMNOPQRSUVWXYZ'
for i in range(N):
    fl = True
    for j in range(i+1,N):
        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)

len_ACGT = [len(x) for x in ACGT]
print(max(len_ACGT)) if len(len_ACGT)>0 else print(0)
import sys
input = sys.stdin.readline # 改行コード「\n」を呼んでしまうため、文字数など、注意！！

s = input().replace("\n","")

ans = 0

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

print(ans)
s = input()

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

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

print(ans)
s = input()
t = "BDEFHIJKLMNOPQRSUVWXYZ"
ans = ""
for x in s:
    if x in t:
        ans += "0"
    else:
        ans += x
print(len(max(ans.split("0"))))
s = input()

ans=0
for i in range(len(s)-1):
    ch=0
    for j in range(i,len(s)):
        if s[j] in 'ACGT':
            ch+=1
        else:
            ans=max(ans,ch)
            ch=0
print(ans)
s = input()

max_value = 0
count = 0
for c in s:
  if c in "ACGT":
    count += 1
  else:
    max_value = max(max_value, count)
    count = 0
print(max_value)
s = input()
a = [i for i in s]
cnt = [0]
count=0
for i in range(len(s)):
  if a[i] == 'A' or a[i] == 'C' or a[i] == 'G' or a[i] == 'T':
    count += 1
  else:
    cnt.append(count)
    count = 0
print(max(cnt))
S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j]
    if s.strip("A C G T") == "":
      l.append(s)

m = sorted(l, key=len)
print(m[-1])
pattern = ["A", "T", "G", "C"]

s = input()

max_count = 0
count = 0
for i in range(len(s)):
    if s[i] in pattern:
        count+=1
    else:
        max_count = max(count, max_count)
        count = 0
        
print(max_count)
import string

S = input()

target = set({'A', 'T', 'C', 'G'})

ss = ''
for i in range(len(S)):
    for d in range(1, min(len(S) - i + 1, 10)):
        SS = S[i:i+d]
        flag = True
        for c in string.ascii_letters:
            if c.upper() in SS and c.upper() not in target:
                flag = False
        if flag and len(ss) < len(SS):
            ss = SS
print(len(ss))
x = list(input())

y = 0
z = 0
for i in range(len(x)):
    if x[i] in ['A', 'C', 'G', 'T']:
        y += 1
    else:
        z = max (z,y)
        y = 0

print(z)
import re
print(len(max(re.split(r'[^ACGT]',input()))))
import re

S = input()

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

ans = 0
for word in match_result:
    if ans <= len(word): ans = len(word)
s = input()
lst = list(s)
cnt = 0
ans = 0
for i in s:
    if i in "ATGC":
        cnt += 1
    else:
        ans = max(cnt,ans)
        cnt = 0
print(ans)
pattern = ["A", "T", "G", "C"]

s = input()

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

print(max_count)
S=input()
s=[str(c) for c in(S)]
M=0
a=0
for i in range(len(s)):
  if s[i]=='A' or s[i]=='G' or s[i]=='C' or s[i]=='T':
    a+=1
  else:
    if M<a:
      M=a
    a=0
print(M)
s = list(input())

tmp = 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":
        tmp += 1
    else:
        if tmp > ans:
            ans = tmp
        tmp = 0

print(ans)
s = input()

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

ans = 0
cnt = 0

for i in s:
    if i not in x:
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0
        
print(ans)
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
print(maxl)
s=input()
ans=0
f=0
preans=0
for i in s:
    if i=="A"or i=="T"or i=="G"or i=="C" :
        if f==0:
            f=1
            preans=1
        else:
            preans+=1
    else:
        ans=max(ans,preans)
        f=0
print(ans)
s=input()
tmp, cnt = 0, 0
for i in range(12):
  try:
    if s[i] in {"A", "C", "G", "T"}:
      tmp += 1
    else:
      cnt = max(cnt, tmp)
      tmp = 0
  except:
    print(cnt)
    exit()
S = input()
cnt = 0
l = ['A', 'C', 'G', 'T']
for s in S:
    res = False
    for i in l:
        if s == i:
            cnt += 1
            res = True
    if cnt > 0 and res == False:
        break
print(cnt)
import bisect,collections,copy,heapq,itertools,math,string
import sys
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()
cnt = 0
max_reg = 0
for x in s:
    if 'A' in x or 'C' in x or 'G' in x or 'T' in x:
        cnt += 1
    else:
        max_reg = max(max_reg,cnt)
        cnt = 0
print(max_reg)
s = input()
ans = 0

if len(s)==1:
    if s.count("A")+s.count("G")+s.count("C")+s.count("T") == 1:
        print(1)
        exit()

 
for i in range(len(s)-1):
    for j in range(i+1, len(s)+1):
        x = s[i:j]
        print(x)
        if x.count("A")+x.count("G")+x.count("C")+x.count("T") == len(x) and len(x) > ans:
            ans = len(x)
 
print(ans)
S = input()
n = len(S)
ans = 0
flag = True
for i in range(n):
  for j in range(i):
    for k in range(i,n+1):
      S_part = S[j:k]
      for s in S_part:
        if not s in "ACGT":
          flag = False
      if flag:
        ans = max(ans,len(S_part))
      flag = True
print(ans)
s = input()
n = len(s)
dp = [0 for i in range(n+1)]
for i in range(n):
    res = 0
    if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
        res = 1
    dp[i+1] = dp[i]+res
print(dp[n])