import re print(max(len(s) for s in re.findall(r"X(?:YZX)*(?:YZ?)?", input())))
XYZZZXYZXYXY
5
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!