print((len(max("".join(str(int(c in{"A","T","G","C"}))for c in eval(input())).split("0")))))
print((len(max("".join(str(int(c in"ATGC"))for c in eval(input())).split("0")))))
print(
    (
        len(
            max(
                "".join(
                    str(int(c in {"A", "T", "G", "C"})) for c in eval(input())
                ).split("0")
            )
        )
    )
)

print((len(max("".join(str(int(c in "ATGC")) for c in eval(input())).split("0")))))

-print( -    ( -        len( -            max( -                "".join( -                    str(int(c in {"A", "T", "G", "C"})) for c in eval(input()) -                ).split("0") -            ) -        ) -    ) -) +print((len(max("".join(str(int(c in "ATGC")) for c in eval(input())).split("0")))))