S=list(eval(input()))

m = 0

ans = 0

for n in S:

    if n in ("A","C","G","T"):

        m += 1

        ans = max(ans,m)

    else:

        m = 0

print(ans)

S = eval(input())

cnt,ans=0,0

for i in S:

    #print(i)

    if i in "ACGT":

        cnt += 1

        #print(cnt)

    else:

        #print(cnt,c)

        ans = max(ans,cnt)

        #print(ans)

        cnt = 0

ans = max(ans,cnt)

print(ans)

S = list(eval(input()))
m = 0
ans = 0
for n in S:
    if n in ("A", "C", "G", "T"):
        m += 1
        ans = max(ans, m)
    else:
        m = 0
print(ans)

S = eval(input())
cnt, ans = 0, 0
for i in S:
    # print(i)
    if i in "ACGT":
        cnt += 1
        # print(cnt)
    else:
        # print(cnt,c)
        ans = max(ans, cnt)
        # print(ans)
        cnt = 0
ans = max(ans, cnt)
print(ans)

-S = list(eval(input())) -m = 0 -ans = 0 -for n in S: -    if n in ("A", "C", "G", "T"): -        m += 1 -        ans = max(ans, m) +S = eval(input()) +cnt, ans = 0, 0 +for i in S: +    # print(i) +    if i in "ACGT": +        cnt += 1 +        # print(cnt) -        m = 0 +        # print(cnt,c) +        ans = max(ans, cnt) +        # print(ans) +        cnt = 0 +ans = max(ans, cnt)