import re;print((max(list(map(len,re.split('[^ACGT]',eval(input())))))))
p=m=0

for c in eval(input()):p=-~p*(c in'ATGC');m=max(m,p)

print(m)
import re

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

p = m = 0
for c in eval(input()):
    p = -~p * (c in "ATGC")
    m = max(m, p)
print(m)

-import re - -print((max(list(map(len, re.split("[^ACGT]", eval(input()))))))) +p = m = 0 +for c in eval(input()): +    p = -~p * (c in "ATGC") +    m = max(m, p) +print(m)