s = eval(input())



count = 0

Max = 0

for i in s:

    if i in "ACGT":

        count += 1

        Max = max(Max, count)

    else:

        count = 0

print(Max)
s = eval(input())

for i in s:

    if i not in "ACGT":

        s = s.replace(i, "1")

s = s.split("1")

print((len(max(s, key=len))))
s = eval(input())
count = 0
Max = 0
for i in s:
    if i in "ACGT":
        count += 1
        Max = max(Max, count)
    else:
        count = 0
print(Max)

s = eval(input())
for i in s:
    if i not in "ACGT":
        s = s.replace(i, "1")
s = s.split("1")
print((len(max(s, key=len))))

-count = 0 -Max = 0 -    if i in "ACGT": -        count += 1 -        Max = max(Max, count) -    else: -        count = 0 -print(Max) +    if i not in "ACGT": +        s = s.replace(i, "1") +s = s.split("1") +print((len(max(s, key=len))))