import re

print((max(list(map(len,re.findall("[ACGT]*",eval(input())))))))
import re

s = eval(input())



print((max(list(map(len,re.split("[^ACGT]",s))))))
import re

print((max(list(map(len, re.findall("[ACGT]*", eval(input())))))))

import re

s = eval(input())
print((max(list(map(len, re.split("[^ACGT]", s))))))

-print((max(list(map(len, re.findall("[ACGT]*", eval(input()))))))) +s = eval(input()) +print((max(list(map(len, re.split("[^ACGT]", s))))))