S = eval(input())+'Z'

X = 'ATCG'

res = [0]

count = 0

for i in S:

    if i in X:

        count += 1

    else:

        res.append(count)

        count = 0

print((max(res)))

S = list(eval(input()))

A = "ATCG"

count = 0

res = [0]

for s in S:

	if s in A:

		count += 1

		res.append(count)

	else:

		count = 0

print((max(res)))
S = eval(input()) + "Z"
X = "ATCG"
res = [0]
count = 0
for i in S:
    if i in X:
        count += 1
    else:
        res.append(count)
        count = 0
print((max(res)))

S = list(eval(input()))
A = "ATCG"
count = 0
res = [0]
for s in S:
    if s in A:
        count += 1
        res.append(count)
    else:
        count = 0
print((max(res)))

-S = eval(input()) + "Z" -X = "ATCG" +S = list(eval(input())) +A = "ATCG" +count = 0 -count = 0 -for i in S: -    if i in X: +for s in S: +    if s in A: +        res.append(count) -        res.append(count)