Problem:
 Score : 200 points    Problem Statement 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 1 ATCODER      Sample Output 1 3  Among the ACGT strings that are substrings of ATCODER , the longest one is ATC .       Sample Input 2 HATAGAYA      Sample Output 2 5  Among the ACGT strings that are substrings of HATAGAYA , the longest one is ATAGA .       Sample Input 3 SHINJUKU      Sample Output 3 0  Among the ACGT strings that are substrings of SHINJUKU , the longest one is (the empty string).

Solution (Python):
s = input()

maxV = 0
length = 0
isChecking = False

for i in range(len(s)):
    if isChecking:
        if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
            length += 1
            if length > maxV:
                maxV = length
        else:
            isChecking = False
    else:
        if s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T':
            isChecking = True
            length = 1
            if length > maxV:
                maxV = length

print(maxV)

Solution (Python):
s=list(input())
cnt=0
ans=0
l=list("ATCG")
 
for i in s:
    if i in l:
        cnt+=1
        ans=max(ans,cnt)
    else:
        cnt=0
print(ans)

Solution (Python):
s = input()
acgt = ["A","C","G","T"]
cnt = 0
cnt_list = []
for i in range(len(s)):
    if s[i] in acgt:
        cnt +=1
        if s[-1] in acgt:
            cnt_list.append(cnt)
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

Solution (Python):
S = list(input())
l = len(S)
ans = 0
for i in range(l - 1):
  if S[i] == "A" or S[i] == "T" or S[i] == "G" or S[i] == "C":
    L = 1
    for j in range(i + 1, l):
      if S[j] == "A" or S[j] == "T" or S[j] == "G" or S[j] == "C":
        L += 1
      else:
        ans = max(ans, L)
        i = j
        break
    ans = max(ans, L)
if S[l - 1] == "A" or S[l - 1] == "T" or S[l - 1] == "G" or S[l - 1] == "C":
  L = 1
  ans = max(ans, L)
print(ans)

Solution (Python):
s=str(input())
a=0
b=0
for i in range(len(s)):
        if s[i] in 'AGCT':
                a+=1
        else:
                b=max(a,b)
                a=0
print(max(a,b))

Solution (Python):
s=str(input())

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


if l==[]:
        print(len(s))
else:
        ans=l[0]
        l.append(len(s))
        for j in range(len(l)-1):
                if l[j+1]-l[j]-1>=ans:
                        ans=l[j+1]-l[j]-1
        print(ans)

Solution (Python):
s = input()

n = len(s)
ans = 0

for i in range(n):
    for j in range(i,n):
        for k in range(i,j+1):
            a = s[k]
            if a!='A' and a!='C' and a!='G' and a!='T':
                break
            if k==j:
                ans=max(ans,j-i+1)

print(ans)

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

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

Solution (Python):

S = input()
ACGT = list('ACGT')

last_max = 0
ret = 0
for c in S:
    if c in ACGT:
        ret += 1
    elif ret > 0:
        last_max = max(ret, last_max)
        ret = 0

print(max(ret, last_max))

Solution (Python):
s=list(input())
cnt=0
ans=0
l=list("ATCG")
 
for i in s:
    if i in l:
        cnt+=1
        ans=max(ans,cnt)
    else:
        cnt=0
print(ans)

Solution (Python):
S = input()
Slist = list(S)
ans = 0
l = 0
for i in range(0, len(Slist)):
	if (Slist[l] == "A" or Slist[l] =="G" or Slist[l] == "C" or Slist[l] == "T") and (Slist[i] == "A" or Slist[i] =="G" or Slist[i] == "C" or Slist[i] == "T"):
		ans = max(ans, len(Slist[l : i+1]))
	else:
		l=i
		
print(ans)

Solution (Python):
s=list(input())
ans=[]
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:
    ans.append(count)
    count=0
    
ans.append(count)    
print(max(ans))

Solution (Python):
S = input()

count = 0
record = 0

for s in S:
  if s == "A" or s == "T" or s == "G" or s == "C":
    count += 1
  else:
    count = 0
  if record < count:
    record = count
    
print(record)

Solution (Python):
s = input()
lm = list("ACGT")
ml = 0
cnt = 0
for i in range(len(s)):
    if s[i] in lm:
        cnt += 1
        ml = max(ml, cnt)
    else:
        cnt = 0
print(ml)

Solution (Python):
S = input()
r = 0
L = []
for c in S:
  if c == "A" or c == "C" or c == "G" or c == "T":
    r += 1
  else:
    L.append(r)
    r = 0
L.append(r)
print(max(L))

Solution (Python):




import math
import statistics

s = input()
length = 0
ans = 0
for ch in s:
    if ch in ('A','C','G','T'):
        length += 1
        ans = max(ans, length)
    else:
        length = 0
print(ans)

Solution (Python):
s=list(input())
cnt=0
ans=0
lis=list("ATCG")

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

Solution (Python):
a = input()
b = 0
c = list("ACGT")
for i in range(len(a)):
    if a[i] in c:
        b = max(b, 1)
        for j in range(i + 1, len(a)):
            if a[j] in c:
                b = max(b, j - i + 1)
            else:
                break
print(b)

Solution (Python):
s = list(input())
lst = []
ans = 0
c = 0
for i in s:
    if i == "A" or i == "C" or i == "G" or i == "T":
        ans += 1
        c = max(c,ans)
    else:
        ans = 0
print(c)

Solution (Python):
s = input()
a = ["A","T","G","C"]
b = []
n = len(s)
for i in range(n):
    if s[i] in a:
        b.append(1)
    else:
        b.append(0)

for i in range(1,n):
    if b[i]>0:
        b[i] = b[i-1] + 1

print(max(b))

Solution (Python):
S = input()
x = ["A","C","G","T"]
for i in range(len(S)):
    if not S[i] in x:
        S = S[:i] + "0" + S[i+1:]
S = S.split("0")
print(max(len(i) for i in S))

Solution (Python):
import re
s=str(input())
s=re.split('[^ACGT]',s)

ans=0
for i in range(len(s)):
    ans=max(ans,len(s[i]))

print(ans)

Solution (Python):


str = input()
acgt = set({'A','C','G','T'})

max_len = 0
work_len = 0
for c in str:
    if c in acgt:
        work_len += 1
    else:
        if max_len < work_len:
            max_len = work_len
        work_len = 0
if work_len > max_len:
    max_len = work_len
print(max_len)

Solution (Python):

s = input()

acgt = {'A', 'T', 'G', 'C'}

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

print(ans)

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

Solution (Python):
S=input()
S=S.replace("C","A").replace("G","A").replace("T","A")
max=0
count=0
for i in range(len(S)):
  if S[i]=="A":
    count += 1
    if max < count:
      max = count
  else:
    count = 0

print(max)

Solution (Python):
s=input()
c=0
an=0

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

print(an)

Solution (Python):
s = input()
a = 0
b = 0
 
for i in s:
    if i in ('A','C','G','T'):
        b += 1
        a = max(a,b)
    else:
        b = 0 
print(a)

Solution (Python):
s = input()

target = "ACGT"
max_len = 0
tmp_len = 0

for i in range(len(s)):
    if s[i] in target:
        tmp_len += 1
    else:
        max_len = max(tmp_len, max_len)
        tmp_len = 0
max_len = max(tmp_len, max_len)
print(max_len)

Solution (Python):
s = input()
ans = []
acgt = ["A", "C", "G", "T"]

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

Solution (Python):
s = list(input())

max = 0
length = 0

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

print(max)

Solution (Python):
s = list(input())

a = set(['A', 'C', 'G', 'T'])

buf = 0
temp = [0]
for i in s:
    if i in a:
        buf += 1
        temp.append(buf)
    else:
        buf = 0

print(max(temp))

Solution (Python):
s = input()
acgt = {'A', 'C', 'G', 'T'}
count = 0
temp_list= []

for c in s:
  if c in acgt:
    count += 1
  else:
    count = 0
  
  temp_list.append(count)
  
print(max(temp_list))

Solution (Python):
s = input()
acgt = set(["A","C","G","T"])
acgt_max = 0
acgt_len = 0
for i in range(len(s)):
    if s[i] in acgt:
        acgt_len += 1
        acgt_max = max(acgt_len, acgt_max)
    else:
        acgt_len = 0
print(acgt_max)

Solution (Python):
def main():
    S = input()
    ans = 0
    for i in range(len(S)):
        for j in range(len(S)+1):
            ans = max(ans, cal_ACGT(S[i:j]))
    print(ans)

def cal_ACGT(substr):
    if (is_ACGT(substr)):
        return len(substr)
    else:
        return 0

def is_ACGT(substr):
    flag = []
    for i in range(len(substr)):
        if(substr[i] == "A"):flag.append(True)
        elif(substr[i] == "C"):flag.append(True)
        elif(substr[i] == "G"):flag.append(True)
        elif(substr[i] == "T"):flag.append(True)
        else:flag.append(False)
    return all(flag)

main()

Solution (Python):
s=input()

n=len(s)
ac=[0]*(n+1)

for i in range(n):
	if s[i]=='A' or s[i]=='T' or s[i]=='G' or s[i]=='C':
		ac[i+1]=ac[i]+1

print(max(ac))

Solution (Python):
s = input()
c = []
cnt = 0

for i, e in enumerate(s):
    if e == "A" or e == "C" or e == "G" or e == "T":
        cnt += 1
    else:
        c.append(cnt)
        cnt = 0
if s[-1] == "A" or s[-1] == "C" or s[-1] == "G" or s[-1] == "T":
    c.append(cnt)
print(max(c))

Solution (Python):
moji_list = input()
ADGT = ["A","C","G","T"]

def count(moji_list,i,cnt,ADGT):
  while moji_list[i] in ADGT:
    cnt+=1
    if i+1 == len(moji_list):
      break
    i+=1
    
  return cnt

cnt_list = []
for i in range(len(moji_list)):
  cnt=0
  cnt_list.append(count(moji_list,i,cnt,ADGT))
  
print(max(cnt_list))

Solution (Python):

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)

Solution (Python):
s = list(str(input()))

count = 0
ACGT = ["A","C","G","T"]
tmp_max = [0]

if all(s) in ACGT:
	print(len(s))
else:
	for letter in s:
		if letter in ACGT:
			count += 1
		else:
			tmp_max.append(count)
			count = 0
	tmp_max.append(count)
	print(max(tmp_max))

Solution (Python):
sss = [i for i in input()]
check = ["A","C","G","T"]
ans = 0 
temp_ans = 0
for s in sss:
  if s in check:
    temp_ans += 1
  else:
    if ans < temp_ans:
      ans = temp_ans
    temp_ans = 0
if ans < temp_ans:
  ans = temp_ans
print(ans)

Solution (Python):
import re

S = input()
l = re.findall(r'[ACGT]+', S)
print(max(map(len, l), default=0))

Solution (Python):
import re

S = input()
l = re.findall(r'[ACGT]+', S)
print(max(map(len, l)) if l else 0)

Solution (Python):
import re

S = input()
l = re.findall(r'[ACGT]+', S)
if l:
  print(max(map(len, l)))
else:
  print(0)

Solution (Python):
S = input()

count = 0
max_count = 0
for i in S:
    if i in ('A', 'T', 'C', 'G'):
        count += 1
    else:
        if count > max_count:
            max_count = count
        count = 0

if count > max_count:
    max_count = count

print(max_count)

Solution (Python):
S = input()
count, max_count = 0, 0
for s in S:
  if s in 'ACGT':
    count += 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(max_count)

Solution (Python):
s=input();cnt=m=0
for i in s:
  if i in "ACGT":
    cnt+=1;m=max(m,cnt)
  else:cnt=0
print(m)

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

Solution (Python):
s = input()
t = "ATGC"

ans = 0
x = 0
for i in range(len(s)):
    if s[i] in t:
        x += 1
    else:
        x = 0
    ans = max(ans, x)

print(ans)

Solution (Python):
def solve():
    S = input()
    S = S+'*' 
    max_sub = 0
    sub_length = 0
    for s in S:
        if s in 'ACGT':
            sub_length += 1
        else: 
            max_sub = max(max_sub, sub_length)
            sub_length = 0
        
    print(max_sub)
    
solve()

Solution (Python):
s = input()
correct_list = ["A","C","G","T"]
x_list = [-1]

for i, c in enumerate(s):
    if c not in correct_list:
        x_list.append(i)
x_list.append(len(s))
diff_list = []
for i in range(len(x_list)-1):
    diff_list.append(x_list[i+1]-x_list[i])
print(max(diff_list)-1)

Solution (Python):

s=input()

c = set("ACGT")
res = 0
for i in range(0, len(s)):
    for j in range(i,len(s)):
        t = s[i:j+1]
        u = len(t)
        t = set(t)
        if t | c == c:
            res = max(res, u)

print(res)

Solution (Python):

S = input()

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

print(cnt_max)

Solution (Python):
s=str(input())
cnt=0
cntmax=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
        cntmax = max(cntmax, cnt)
    else:
        cnt = 0
print(cntmax)

Solution (Python):
"""


 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())


 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  


a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    S= list(sys.stdin.readline().rstrip())
    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)

Solution (Python):
S = input()

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

print(ans)

Solution (Python):


S = input()

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

tmpLen = 0
maxLen = 0

for i in range(len(S)):
    if isValidChar(S[i]):
        tmpLen += 1
        maxLen = max(maxLen, tmpLen)
    else:
        tmpLen = 0

print(maxLen)

Solution (Python):
s = input()
lis = ["A", "G", "C", "T"]
count = 0
ans = 0

for i in range(len(s)):
    for j in range(i, len(s)):
        if s[j] in lis:
            count += 1
        else:
            break
    ans = max(ans, count)
    count = 0

print(ans)

Solution (Python):
S = input()
N = len(S)


def check(T):
    M = len(T)
    for m in range(M):
        if T[m] not in "ATCG":
            return False
    return True


ans = 0
for i in range(N):
    for j in range(i + 1, N + 1):
        T = S[i:j]
        if check(T):
            ans = max(ans, len(T))
print(ans)

Solution (Python):
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)

Solution (Python):
S = str(input())
max_length = 0
combo = 0
bases = set("ATGC")
for i in range(len(S)):
    if S[i] in bases:
        combo += 1
        if max_length < combo:
        	max_length = combo
    else:
        combo = 0

print(max_length)

Solution (Python):
s=input()
n=len(s)
list=["A","C","G","T"]
new=[]
a=0
for i in range(n):
  if s[i] in list:
    a+=1
    if i == n-1:
      new.append(a)
  if s[i] not in list:
    new.append(a)
    a=0
print(max(new))

Solution (Python):
S = list(input())
ans = []
count = 0
for i in range(len(S)):
    if S[i]=='A' or S[i]=='T' or S[i]== 'C' or S[i]== 'G':
        count += 1
        if i == len(S)-1 :
            ans.append(count)
    else:
        ans.append(count)
        count = 0
print(max(ans))

Solution (Python):
Str = list(input())
tmp = 0
maxLen = 0

for s in Str:
    if s in "ACGT":
        tmp += 1
        maxLen = max(maxLen, tmp)
    else:
        tmp = 0


print(maxLen)

Solution (Python):
S = input()
n = [0]
k=0
for c in S:
    if c in 'ACGT':
        k+=1
    elif k>0:
        n.append(k)
        k=0
if k>0: n.append(k)

print(max(n))

Solution (Python):
S = input()
S_list = list(S)

cnt = 0
max_s = 0

for s in S_list:
    if (s == "A") or (s == "C") or (s == "G") or (s == "T"):
        cnt += 1
    else:
        if max_s < cnt:
            max_s = cnt
        cnt = 0
if max_s < cnt:
    max_s = cnt
print(max_s)

Solution (Python):
S = input()
N = len(S)

cnt = 0



for i in range(N):
    for j in range(i, N):
        if all([s in "ACGT" for s in S[i:j+1]]):
            cnt = max(cnt, len(S[i:j+1]))

print(cnt)

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
a = input()
b = 0
c = 0
for i in range(len(a)):
    if a[i] in list("ACGT"):
        b += 1
        c = max(c, b)
    else:
        b = 0
print(c)

Solution (Python):
s = input()

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

Solution (Python):
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)

Solution (Python):
print(len(max(''.join(['a' if t in ['A','T','G','C'] else ',' for t in input()]).split(','))))

Solution (Python):
print(max([len(x) for x in ''.join(['a' if t=='A' or t=='T' or t=='G' or t=='C' else ',' for t in input()]).split(",")]))

Solution (Python):
s = input()
ans = 0
li = ["A", "C", "G", "T"]
count = 0
for i in s:
    if i in li:
        count += 1
    else:
        if count > ans:
            ans = count
        count = 0

if count > ans:
    ans = count
print(ans)

Solution (Python):
a = input()
b = c = 0
d = list("ACGT")
for i in range(len(a)):
    if a[i] in d:
        c += 1
        b = max(b, c)
    else:
        c = 0
print(b)

Solution (Python):
n = input()
max_ = 0
m = 0
for i in range(len(n)):
    if n[i] == "A" or n[i] == "C" or n[i] == "T" or n[i] == "G":
        m += 1
        if i == len(n) - 1:
            max_ = max(m,max_)
    else:
        max_ = max(m,max_)
        m = 0
print(max_)

Solution (Python):
def counter(p):
    if p == 'A':
        return 1
    elif p == 'C':
        return 1
    elif p == 'G':
        return 1
    elif p == 'T':
        return 1
    else:
        return 0

count = 0
max_b = 0

S = input()
Sl = list(S)

for i in Sl:

    if counter(i) == 1:
        count += 1
    else:
        count = 0
    
    max_b = max(max_b,count)

print(max_b)

Solution (Python):
S = input()

def AGCT(S,i):
    if S[i] == "A" or S[i] == "T" or S[i] == "G" or S[i] == "C":
        return 0
    else:
        return 1

c = 0
ANS = []
for i in range(len(S)):
    if AGCT(S,i) == 0:
        c += 1
    else:
        ANS.append(c)
        c = 0
ANS.append(c)
print(max(ANS))

Solution (Python):
s = list(input())
cnt = 0
tmp =[0]
for i in s:
  if i in ['A','C','G','T']:
    cnt +=1
    tmp.append(cnt)
  else:
    cnt = 0
print(max(tmp))

Solution (Python):
S = input()
ACGT = {"A", "C", "G", "T"}

ans = 0
tmp = 0

for s in S:
    if s in ACGT:
        tmp += 1
        if ans < tmp:
            ans = tmp
    else:
        tmp = 0

print(ans)

Solution (Python):
def main():

    """ convenient functions
    
    
    
    
    
    """

    """convenient decorator
    
    
        
        
        
        
        
        
        
        
        
        
    """
    
    
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product 
    
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  
        b, e = 2, 0  
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict 
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest 
    from copy import deepcopy, copy 
    import operator
    from operator import itemgetter
    
    
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd 
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    
    
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) 
    def modinv(a, p = MOD):
        
        
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        
        
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    """ initialize variables and set inputs
    
        
        
    
        
        
        
        
        
    
        
        
        
        
    
        
        
    """

    
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    
    
    
    
    
    
    
    """

    if __name__ != '__main__':
        
        sys.stdin = open('sample.txt')

    
    

    S = r()
    tmp = 0
    ans = 0
    for i in S:
        if i in ('A', 'T', 'G', 'C'):
            tmp += 1
            ans = max(ans, tmp)
        else:
            tmp = 0
            
    print(ans)
    
    
    

    """memo: how to use defaultdict of list
    
    Dic = defaultdict(list)
    
    Dic[x].append(y)
    
    for k, v in Dic.items():
    """

if __name__ == '__main__':
    main()

Solution (Python):
import re
s = input()
ans = [re.search("[AGCT]*", s[i:]) for i in range(len(s))]
ans = max([len(x.group(0)) if x else 0 for x in ans])
print(ans)

Solution (Python):
s = input()
ans = 0
acgt = 0
for c in s:
    if c == 'A' or c == 'C' or c == 'G' or c == 'T':
        acgt += 1
    else:
        acgt = 0
    ans = max(ans, acgt)

print(ans)

Solution (Python):
S = input()
ans = 0
size = 0
for s in S:
    if s == "A" or s == "C" or s == "G" or s == "T":
        size += 1
    else:
        ans = max(ans, size)
        size = 0
print(max(ans, size))

Solution (Python):
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = list(inputs[0])
    ACGT = {"A", "C", "G", "T"}

    max_length = 0
    for i in range(0, len(S)):
        length = 0
        j = i
        while j < len(S) and S[j] in ACGT:
            length += 1
            j += 1
        max_length = length if length > max_length else max_length
    return max_length


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

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

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

Solution (Python):
S=list(input())
li=0
li2=[]
for i in S:
	if i=='A' or i=='C' or i=='G' or i=='T':
		li+=1
	else:
		li2.append(li)
		li=0
li2.append(li)
print(max(li2))

Solution (Python):
inp = input()
inpmax, inplen = 0, 0
for inp_c in inp:
  if inp_c in 'ATCG':
    inplen += 1
  else:
    inpmax = max(inpmax, inplen)
    inplen = 0
inpmax = max(inpmax, inplen)
print(inpmax)

Solution (Python):
s = str(input())

if set(list(s)) <= {'A', 'T', 'G', 'C'}:
  print(len(s))
  exit()

ans = 0

for i in range(len(s)):
  for j in range(i, len(s)+1):
    sp = s[i:j]
    sp = list(sp) 
    if set(sp) <= {'A', 'T', 'G', 'C'}:
      ans = max(ans, len(sp))
print(ans)

Solution (Python):
S = input()

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

print(max(L[:]))

Solution (Python):
a = input()
b = ["A", "G", "C", "T"]
c = d = 0
for i in range(len(a)):
    if a[i] in b:
        c += 1
        d = max(d, c)
    else:
        c = 0
print(d)

Solution (Python):
s = input()
smax = 0
slen = 0
for c in s:
  if c in 'ATCG':
    slen += 1
  else:
    smax = max(smax, slen)
    slen = 0
smax = max(smax, slen)
print(smax)

Solution (Python):


S = input()
ans = 0
l, r = 0, 0
ls = len(S)

for i in range(ls):
    if S[i] in "ATGC":
        r += 1
    else:
        r += 1
        l = r
    ans = max(ans, r-l)
print(ans)

Solution (Python):
def main():
    S = input()

    acgt = []
    flag = False
    count = 0
    for s in S:
        if s == "A" or s == "C" or s == "G" or s == "T":
            if flag:
                count += 1
            else:
                flag = True
                count = 1
        else:
            acgt.append(count)
            flag = False
            count = 0

    if count > 0:
        acgt.append(count)
        
    print(max(acgt))


if __name__ == '__main__':
    main()

Solution (Python):
ACGT = ['A', 'C', 'G', 'T']
S = input()
countlist = [0]
if S[0] in ACGT:
	countlist[0] += 1
for i in range(1, len(S)):
	if S[i] in ACGT:
		countlist.append(countlist[-1]+1)
	else:
		countlist.append(0)
countlist.sort()
print(countlist[-1])

Solution (Python):
s = list(input())

ans = []

for i in range(len(s)):
	ans.append(0)
	j = i
	while s[j] == "A" or s[j] == "C" or s[j] == "G" or s[j] == "T" :
		ans[i] += 1
		if j >= len(s) - 1:
			break
		else:
			j += 1
		
ans =sorted(ans, reverse = True)

print(ans[0])

Solution (Python):
s = input()

n = len(s)

ans = 0

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

print(ans)

Solution (Python):
s = input()

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