a = eval(input())

b = 0

c = 0

for i in range(len(a)):

    if a[i] in list("ACGT"):

        b += 1

        c = max(c, b)

    else:

        b = 0

print(c)

a = eval(input())

b = 0

c = list("ACGT")

for i in range(len(a)):

    if a[i] in c:

        b = max(b, 1)

        for j in range(i + 1, len(a)):

            if a[j] in c:

                b = max(b, j - i + 1)

            else:

                break

print(b)

a = eval(input())
b = 0
c = 0
for i in range(len(a)):
    if a[i] in list("ACGT"):
        b += 1
        c = max(c, b)
    else:
        b = 0
print(c)

a = eval(input())
b = 0
c = list("ACGT")
for i in range(len(a)):
    if a[i] in c:
        b = max(b, 1)
        for j in range(i + 1, len(a)):
            if a[j] in c:
                b = max(b, j - i + 1)
            else:
                break
print(b)

-c = 0 +c = list("ACGT") -    if a[i] in list("ACGT"): -        b += 1 -        c = max(c, b) -    else: -        b = 0 -print(c) +    if a[i] in c: +        b = max(b, 1) +        for j in range(i + 1, len(a)): +            if a[j] in c: +                b = max(b, j - i + 1) +            else: +                break +print(b)