S = eval(input())

ls = list(S)

ans = 0

for i in range(len(ls)):

    cnt = 0

    for j in range(i,len(ls)):

        if S[j] in ['A','T','C','G']:

            cnt += 1

            if j == len(ls) - 1:

                ans = max(ans,cnt)

        else:

            ans = max(ans,cnt)

            break

print(ans)
S=eval(input())

cnt1=0

for i in range(len(S)):

  cnt2=0

  for j in range(i,len(S)):

    if S[j] in ("A","C","G","T"):

      cnt2+=1

    else:

      break

  cnt1=max(cnt1,cnt2)

print(cnt1)
S = eval(input())
ls = list(S)
ans = 0
for i in range(len(ls)):
    cnt = 0
    for j in range(i, len(ls)):
        if S[j] in ["A", "T", "C", "G"]:
            cnt += 1
            if j == len(ls) - 1:
                ans = max(ans, cnt)
        else:
            ans = max(ans, cnt)
            break
print(ans)

S = eval(input())
cnt1 = 0
for i in range(len(S)):
    cnt2 = 0
    for j in range(i, len(S)):
        if S[j] in ("A", "C", "G", "T"):
            cnt2 += 1
        else:
            break
    cnt1 = max(cnt1, cnt2)
print(cnt1)

-ls = list(S) -ans = 0 -for i in range(len(ls)): -    cnt = 0 -    for j in range(i, len(ls)): -        if S[j] in ["A", "T", "C", "G"]: -            cnt += 1 -            if j == len(ls) - 1: -                ans = max(ans, cnt) +cnt1 = 0 +for i in range(len(S)): +    cnt2 = 0 +    for j in range(i, len(S)): +        if S[j] in ("A", "C", "G", "T"): +            cnt2 += 1 -            ans = max(ans, cnt) -print(ans) +    cnt1 = max(cnt1, cnt2) +print(cnt1)