S = eval(input())



ans = 0

ACGT = ("A", "C", "G", "T")



count = 0

count_list = [0]

for s in S:

    if s not in ACGT:

        count_list.append(count)

        count = 0

        continue

    else:

        count += 1

count_list.append(count)

print((max(count_list)))
S = eval(input())



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



count = 0

max_count = 0

for s in S:

    if s in ACGT:

        count += 1

    else:

        max_count = max(max_count, count)

        count = 0

max_count = max(max_count, count)

print(max_count)
S = eval(input())
ans = 0
ACGT = ("A", "C", "G", "T")
count = 0
count_list = [0]
for s in S:
    if s not in ACGT:
        count_list.append(count)
        count = 0
        continue
    else:
        count += 1
count_list.append(count)
print((max(count_list)))

S = eval(input())
ACGT = ["A", "C", "G", "T"]
count = 0
max_count = 0
for s in S:
    if s in ACGT:
        count += 1
    else:
        max_count = max(max_count, count)
        count = 0
max_count = max(max_count, count)
print(max_count)

-ans = 0 -ACGT = ("A", "C", "G", "T") +ACGT = ["A", "C", "G", "T"] -count_list = [0] +max_count = 0 -    if s not in ACGT: -        count_list.append(count) +    if s in ACGT: +        count += 1 +    else: +        max_count = max(max_count, count) -        continue -    else: -        count += 1 -count_list.append(count) -print((max(count_list))) +max_count = max(max_count, count) +print(max_count)