s = eval(input())



c = 0

mx = 0

for si in s:

    if si in ("A", "C", "G", "T"):

        c += 1

        if c > mx:

            mx = c

    else:

        c = 0



print(mx)

S = eval(input())

mx = 0

for i in range(len(S)):

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

        s = S[i:j]

        flag = True

        for si in s:

            if si not in ["A", "C", "G", "T"]:

                flag = False

        if flag:

            mx = max(mx, len(s))



print(mx)

s = eval(input())
c = 0
mx = 0
for si in s:
    if si in ("A", "C", "G", "T"):
        c += 1
        if c > mx:
            mx = c
    else:
        c = 0
print(mx)

S = eval(input())
mx = 0
for i in range(len(S)):
    for j in range(i, len(S) + 1):
        s = S[i:j]
        flag = True
        for si in s:
            if si not in ["A", "C", "G", "T"]:
                flag = False
        if flag:
            mx = max(mx, len(s))
print(mx)

-s = eval(input()) -c = 0 +S = eval(input()) -for si in s: -    if si in ("A", "C", "G", "T"): -        c += 1 -        if c > mx: -            mx = c -    else: -        c = 0 +for i in range(len(S)): +    for j in range(i, len(S) + 1): +        s = S[i:j] +        flag = True +        for si in s: +            if si not in ["A", "C", "G", "T"]: +                flag = False +        if flag: +            mx = max(mx, len(s))