S = eval(input())

res = 0

temp = 0

for i in range(len(S)):

  if S[i] in ["A", "T", "C", "G"]:

    temp += 1

    res = max(temp, res)

  else:

    temp = 0

print(res)
import sys

input = sys.stdin.readline

S = list(eval(input()))[: -1]

res = 0

for l in range(len(S)):

  for r in range(l + 1, len(S) + 1):

    for i in range(l, r):

      if not S[i] in ["A", "T", "C", "G"]: break

    else: res = max(res, r - l)

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

import sys

input = sys.stdin.readline
S = list(eval(input()))[:-1]
res = 0
for l in range(len(S)):
    for r in range(l + 1, len(S) + 1):
        for i in range(l, r):
            if not S[i] in ["A", "T", "C", "G"]:
                break
        else:
            res = max(res, r - l)
print(res)

-S = eval(input()) +import sys + +input = sys.stdin.readline +S = list(eval(input()))[:-1] -temp = 0 -for i in range(len(S)): -    if S[i] in ["A", "T", "C", "G"]: -        temp += 1 -        res = max(temp, res) -    else: -        temp = 0 +for l in range(len(S)): +    for r in range(l + 1, len(S) + 1): +        for i in range(l, r): +            if not S[i] in ["A", "T", "C", "G"]: +                break +        else: +            res = max(res, r - l)