# -*- coding: utf-8 -*-



def main():

    b = eval(input())



    maxcnt = 0

    scnt = 0

    for c in b:

        if(c=='A' or c=='C' or c=='G' or c=='T'):

            scnt += 1

        else:

            if(maxcnt<scnt):

                maxcnt=scnt

            scnt = 0



    print((max(scnt,maxcnt)))



main()
from sys import stdin



matches = ['A','C','G','T']

S = stdin.readline().rstrip()

cnt_row = 0

cnt_max = 0

for s in S:

    if s in matches:

        cnt_row += 1

        if cnt_max < cnt_row:

            cnt_max = cnt_row

    else:

        cnt_row = 0

print(cnt_max)
# -*- coding: utf-8 -*-
def main():
    b = eval(input())
    maxcnt = 0
    scnt = 0
    for c in b:
        if c == "A" or c == "C" or c == "G" or c == "T":
            scnt += 1
        else:
            if maxcnt < scnt:
                maxcnt = scnt
            scnt = 0
    print((max(scnt, maxcnt)))


main()

from sys import stdin

matches = ["A", "C", "G", "T"]
S = stdin.readline().rstrip()
cnt_row = 0
cnt_max = 0
for s in S:
    if s in matches:
        cnt_row += 1
        if cnt_max < cnt_row:
            cnt_max = cnt_row
    else:
        cnt_row = 0
print(cnt_max)

-# -*- coding: utf-8 -*- -def main(): -    b = eval(input()) -    maxcnt = 0 -    scnt = 0 -    for c in b: -        if c == "A" or c == "C" or c == "G" or c == "T": -            scnt += 1 -        else: -            if maxcnt < scnt: -                maxcnt = scnt -            scnt = 0 -    print((max(scnt, maxcnt))) +from sys import stdin - -main() +matches = ["A", "C", "G", "T"] +S = stdin.readline().rstrip() +cnt_row = 0 +cnt_max = 0 +for s in S: +    if s in matches: +        cnt_row += 1 +        if cnt_max < cnt_row: +            cnt_max = cnt_row +    else: +        cnt_row = 0 +print(cnt_max)