s = eval(input())

a = ['A','C','G','T']

c = 0

j = 0



for i in range(len(s)):

    if s[i] in a:

        j += 1

    else:

        if j > c:

            c = j

            j = 0



if j > c:

    print(j)

else:

    print(c)
s = eval(input())

acgt = ['A','C','G','T']

ans = 0

p = 0

for i in range(len(s)):

    if s[i] in acgt:

        p += 1

    else:

        ans = max(ans,p)

        p = 0

print((max(ans,p)))
s = eval(input())
a = ["A", "C", "G", "T"]
c = 0
j = 0
for i in range(len(s)):
    if s[i] in a:
        j += 1
    else:
        if j > c:
            c = j
            j = 0
if j > c:
    print(j)
else:
    print(c)

s = eval(input())
acgt = ["A", "C", "G", "T"]
ans = 0
p = 0
for i in range(len(s)):
    if s[i] in acgt:
        p += 1
    else:
        ans = max(ans, p)
        p = 0
print((max(ans, p)))

-a = ["A", "C", "G", "T"] -c = 0 -j = 0 +acgt = ["A", "C", "G", "T"] +ans = 0 +p = 0 -    if s[i] in a: -        j += 1 +    if s[i] in acgt: +        p += 1 -        if j > c: -            c = j -            j = 0 -if j > c: -    print(j) -else: -    print(c) +        ans = max(ans, p) +        p = 0 +print((max(ans, p)))