s = list(eval(input()))

n = len(s)

count = 0

maxcount = 0

for i in range(n):

  if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":

    count += 1

    maxcount = max(maxcount,count)

  else:

    count = 0



print(maxcount)
s=eval(input())

ans=0

cnt=0

for i in range(len(s)):

  if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T":

    cnt+=1

  else:

    ans=max(ans,cnt)

    cnt=0

ans=max(ans,cnt)

print(ans)
s = list(eval(input()))
n = len(s)
count = 0
maxcount = 0
for i in range(n):
    if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T":
        count += 1
        maxcount = max(maxcount, count)
    else:
        count = 0
print(maxcount)

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

-s = list(eval(input())) -n = len(s) -count = 0 -maxcount = 0 -for i in range(n): +s = eval(input()) +ans = 0 +cnt = 0 +for i in range(len(s)): -        count += 1 -        maxcount = max(maxcount, count) +        cnt += 1 -        count = 0 -print(maxcount) +        ans = max(ans, cnt) +        cnt = 0 +ans = max(ans, cnt) +print(ans)