import re



m = re.findall(r'[ATCG]+', eval(input()))

if m:

    print((max([len(x) for x in m])))

else:

    print('0')

import re



m = re.findall(r'[ATCG]+', eval(input()))

print((max([len(x) for x in m]) if m else '0'))

import re

m = re.findall(r"[ATCG]+", eval(input()))
if m:
    print((max([len(x) for x in m])))
else:
    print("0")

import re

m = re.findall(r"[ATCG]+", eval(input()))
print((max([len(x) for x in m]) if m else "0"))

-if m: -    print((max([len(x) for x in m]))) -else: -    print("0") +print((max([len(x) for x in m]) if m else "0"))