s = eval(input())



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

l=[]

for i in range(len(s)):

    if s[i] in a_s:

        l.append(1)

    else:

        l.append(0)



cnt = 0

ans = 0

for i in range(len(s)):

    if l[i] == 1:

        cnt += 1

    else:

        ans = max(cnt,ans)

        cnt = 0

ans = max(cnt,ans)

print(ans)

s = eval(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 = eval(input())
a_s = ["A", "C", "G", "T"]
l = []
for i in range(len(s)):
    if s[i] in a_s:
        l.append(1)
    else:
        l.append(0)
cnt = 0
ans = 0
for i in range(len(s)):
    if l[i] == 1:
        cnt += 1
    else:
        ans = max(cnt, ans)
        cnt = 0
ans = max(cnt, ans)
print(ans)

s = eval(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 = eval(input()) -a_s = ["A", "C", "G", "T"] -l = [] -for i in range(len(s)): -    if s[i] in a_s: -        l.append(1) -    else: -        l.append(0) +s = eval(input()) + "_" -    if l[i] == 1: +    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": -        ans = max(cnt, ans) +        ans = max(ans, cnt) -ans = max(cnt, ans)