S = str(input()) chiwawa_index_dict = {"c": 0, "first_w": 0, "second_w": 0} has_filled_c = False has_filled_first_w = False has_filled_second_w = False for i, word in enumerate(S): print(word) print(chiwawa_index_dict) if word == "c" and not has_filled_c: chiwawa_index_dict["c"] = i has_filled_c = True elif word == "w" and has_filled_c and not has_filled_first_w: chiwawa_index_dict["first_w"] = i has_filled_first_w = True elif word == "w" and has_filled_c and has_filled_first_w and not has_filled_second_w: chiwawa_index_dict["second_w"] = i has_filled_second_w = True break if has_filled_second_w: print(chiwawa_index_dict["second_w"] - chiwawa_index_dict["c"] + 1) else: print(-1)