def is_c(s: str) -> bool: return s == "c" def is_w(w: str) -> bool: return w == "w" def is_cww(start_flag: bool, w_count: int) -> bool: return w_count == 2 and start_flag def main(): S = input() ans = -1 start_flag = False tmp = 0 w_count = 0 for s in S: if is_c(s): start_flag = True tmp += 1 continue if not start_flag: continue tmp += 1 if is_w(s): w_count += 1 if is_cww(start_flag, w_count): ans = max(ans, tmp) start_flag = False tmp = 0 continue print(ans) if __name__ == "__main__": main()