#!/usr/bin/env python3

def main():

    S = eval(input())



    lst = set(['A', 'C', 'G', 'T'])

    cnt = 0

    ans = 0

    for s in S:

        if s in lst:

            cnt += 1

        else:

            ans = max(ans, cnt)

            cnt = 0

    ans = max(ans, cnt)

    print(ans)





if __name__ == '__main__':

    main()

def resolve():

    S = eval(input())

    ans, cnt = 0, 0

    for s in S:

        if s == 'A' or s == 'C'or s == 'G' or s == 'T':

            cnt += 1

        else:

            ans = max(ans, cnt)

            cnt = 0

    ans = max(ans, cnt)

    print(ans)



resolve()

#!/usr/bin/env python3
def main():
    S = eval(input())
    lst = set(["A", "C", "G", "T"])
    cnt = 0
    ans = 0
    for s in S:
        if s in lst:
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
    ans = max(ans, cnt)
    print(ans)


if __name__ == "__main__":
    main()

def resolve():
    S = eval(input())
    ans, cnt = 0, 0
    for s in S:
        if s == "A" or s == "C" or s == "G" or s == "T":
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
    ans = max(ans, cnt)
    print(ans)


resolve()

-#!/usr/bin/env python3 -def main(): +def resolve(): -    lst = set(["A", "C", "G", "T"]) -    cnt = 0 -    ans = 0 +    ans, cnt = 0, 0 -        if s in lst: +        if s == "A" or s == "C" or s == "G" or s == "T": -if __name__ == "__main__": -    main() +resolve()