s=eval(input())

a=0

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

k=0

for i in range(len(s)):

    if s[i] in b:

        k+=1

        if i==len(s)-1 and k>a:

            a=k

    else:

        if k>a:

            a=k

        k=0



print(a)

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

ans=0

now=0

for i in eval(input()):

    if i in x:

        now+=1

    else:

        now=0

    ans=max(now,ans)

print(ans)

s = eval(input())
a = 0
b = ["A", "C", "G", "T"]
k = 0
for i in range(len(s)):
    if s[i] in b:
        k += 1
        if i == len(s) - 1 and k > a:
            a = k
    else:
        if k > a:
            a = k
        k = 0
print(a)

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

-s = eval(input()) -a = 0 -b = ["A", "C", "G", "T"] -k = 0 -for i in range(len(s)): -    if s[i] in b: -        k += 1 -        if i == len(s) - 1 and k > a: -            a = k +x = ["A", "G", "C", "T"] +ans = 0 +now = 0 +for i in eval(input()): +    if i in x: +        now += 1 -        if k > a: -            a = k -        k = 0 -print(a) +        now = 0 +    ans = max(now, ans) +print(ans)