#python3

from collections import Counter

def main():

    s = eval(input())

    ans = 0

    cnt = 0

    for i in range(len(s)):

        if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):

            cnt += 1

        else:

            cnt = 0

        ans = max(ans, cnt)

    print(ans)

main()

#python3

def main():

    s = eval(input())

    ans = 0

    cnt = 0

    for i in range(len(s)):

        if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):

            cnt += 1

        else:

            cnt = 0

        ans = max(ans, cnt)

    print(ans)

main()

# python3
from collections import Counter


def main():
    s = eval(input())
    ans = 0
    cnt = 0
    for i in range(len(s)):
        if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):
            cnt += 1
        else:
            cnt = 0
        ans = max(ans, cnt)
    print(ans)


main()

# python3
def main():
    s = eval(input())
    ans = 0
    cnt = 0
    for i in range(len(s)):
        if (s[i] == "A") | (s[i] == "T") | (s[i] == "C") | (s[i] == "G"):
            cnt += 1
        else:
            cnt = 0
        ans = max(ans, cnt)
    print(ans)


main()

-from collections import Counter - -