import re

S = eval(input())

S = list(map(len, re.sub('[^ACGT]', ',', S).split(',')))

print((max(S)))
S = eval(input())

ans = 0

count = 0

for s in S:

    if s in 'ACGT':

        count += 1

    else:

        ans = max(ans, count)

        count = 0

else:

    ans = max(ans, count)

print(ans)
import re

S = eval(input())
S = list(map(len, re.sub("[^ACGT]", ",", S).split(",")))
print((max(S)))

S = eval(input())
ans = 0
count = 0
for s in S:
    if s in "ACGT":
        count += 1
    else:
        ans = max(ans, count)
        count = 0
else:
    ans = max(ans, count)
print(ans)

-import re - -S = list(map(len, re.sub("[^ACGT]", ",", S).split(","))) -print((max(S))) +ans = 0 +count = 0 +for s in S: +    if s in "ACGT": +        count += 1 +    else: +        ans = max(ans, count) +        count = 0 +else: +    ans = max(ans, count) +print(ans)