s=eval(input())

ans=0

c=0

d={"A","C","G","T"}

for i in range(len(s)):

    if not s[i] in d:

        ans=max(ans,c)

        c=0

    else:

        c+=1

ans=max(ans,c)



print(ans)

s=eval(input())

ans=0

c=0

for i in range(len(s)):

    if s[i] in ["A","C","G","T"]:

        c+=1

    else:

        c=0

    ans=max(ans,c)

print(ans)
s = eval(input())
ans = 0
c = 0
d = {"A", "C", "G", "T"}
for i in range(len(s)):
    if not s[i] in d:
        ans = max(ans, c)
        c = 0
    else:
        c += 1
ans = max(ans, c)
print(ans)

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

-d = {"A", "C", "G", "T"} -    if not s[i] in d: -        ans = max(ans, c) +    if s[i] in ["A", "C", "G", "T"]: +        c += 1 +    else: -    else: -        c += 1 -ans = max(ans, c) +    ans = max(ans, c)