"""main.py""" def main(): """Output the smaller index.""" sample = input() exclude_string = "ccw" from_left_index = sample.find(exclude_string) + 1 from_right_index = ''.join(list(reversed(sample))).find("wcc") + 1 print(min(from_left_index, from_right_index)) if __name__ == "__main__": main()