s = eval(input())

maxs = 0

cnt = 0

for i, x in enumerate(s):

    if x in ['A', 'C', 'G', 'T']:

        cnt += 1

    else:

        if cnt > 0:

            maxs = max(maxs, cnt)

            cnt = 0

if cnt > 0:

    maxs = max(maxs, cnt)

print(maxs)
s = eval(input())



max_cnt = 0

cnt = 0

for i in s:

    if i in ['A', 'C', 'G', 'T']:

        cnt += 1

    else:

        max_cnt = max(cnt, max_cnt)

        cnt = 0



print((max(max_cnt, cnt)))
s = eval(input())
maxs = 0
cnt = 0
for i, x in enumerate(s):
    if x in ["A", "C", "G", "T"]:
        cnt += 1
    else:
        if cnt > 0:
            maxs = max(maxs, cnt)
            cnt = 0
if cnt > 0:
    maxs = max(maxs, cnt)
print(maxs)

s = eval(input())
max_cnt = 0
cnt = 0
for i in s:
    if i in ["A", "C", "G", "T"]:
        cnt += 1
    else:
        max_cnt = max(cnt, max_cnt)
        cnt = 0
print((max(max_cnt, cnt)))

-maxs = 0 +max_cnt = 0 -for i, x in enumerate(s): -    if x in ["A", "C", "G", "T"]: +for i in s: +    if i in ["A", "C", "G", "T"]: -        if cnt > 0: -            maxs = max(maxs, cnt) -            cnt = 0 -if cnt > 0: -    maxs = max(maxs, cnt) -print(maxs) +        max_cnt = max(cnt, max_cnt) +        cnt = 0 +print((max(max_cnt, cnt)))