s = list(eval(input()))

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

count = 0

flag = False

ans = 0

for i in range(len(s)):

  if s[i] in key:

    count += 1

    flag = True

  if flag==True and (s[i] not in key):

    ans = max(ans,count)

    count = 0

    flag = False

ans = max(ans,count)

print(ans)
s = list(eval(input()))

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



count = 0

ans = 0

for i in range(len(s)):

  if s[i] in key: count += 1

  else: count = 0

  ans = max(ans,count)

print(ans)

s = list(eval(input()))
key = ["A", "T", "G", "C"]
count = 0
flag = False
ans = 0
for i in range(len(s)):
    if s[i] in key:
        count += 1
        flag = True
    if flag == True and (s[i] not in key):
        ans = max(ans, count)
        count = 0
        flag = False
ans = max(ans, count)
print(ans)

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

-flag = False -        flag = True -    if flag == True and (s[i] not in key): -        ans = max(ans, count) +    else: -        flag = False -ans = max(ans, count) +    ans = max(ans, count)