import re

S = eval(input())

pattern = '[AGCT]+'

print((max(list(map(len, re.findall(pattern, S))), default=0)))
S = eval(input())



src = ["A","T","C","G"]

ok = True

ans = 0

tmp = 0

for s in S:

    if not ok:

        tmp = 0

    ok = s in src

    if ok:

        tmp += 1

    ans = max(ans, tmp)

print(ans)
import re

S = eval(input())
pattern = "[AGCT]+"
print((max(list(map(len, re.findall(pattern, S))), default=0)))

S = eval(input())
src = ["A", "T", "C", "G"]
ok = True
ans = 0
tmp = 0
for s in S:
    if not ok:
        tmp = 0
    ok = s in src
    if ok:
        tmp += 1
    ans = max(ans, tmp)
print(ans)

-import re - -pattern = "[AGCT]+" -print((max(list(map(len, re.findall(pattern, S))), default=0))) +src = ["A", "T", "C", "G"] +ok = True +ans = 0 +tmp = 0 +for s in S: +    if not ok: +        tmp = 0 +    ok = s in src +    if ok: +        tmp += 1 +    ans = max(ans, tmp) +print(ans)