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

ans=chk=0

s=eval(input())

for i in s:

    if i in d:

        chk+=1

        ans=max(ans,chk)

    else:

        chk=0

print(ans)

s=eval(input())

ans=chk=0

for i in s:

    if i in "ACGT": chk+=1

    else: chk=0

    ans=max(ans,chk)

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

s = eval(input())
ans = chk = 0
for i in s:
    if i in "ACGT":
        chk += 1
    else:
        chk = 0
    ans = max(ans, chk)
print(ans)

-d = {"A", "C", "G", "T"} +s = eval(input()) -s = eval(input()) -    if i in d: +    if i in "ACGT": -        ans = max(ans, chk) +    ans = max(ans, chk)