Company: Juspay_29aug
Difficulty: medium
Parade in HackerLand HackerLand is lining up marchers for a parade. Each marcher wears a uniform that is either red or blue, and the lineup is described by a binary string color , read from the front of the parade to the back: '0' means the marcher wears red. '1' means the marcher wears blue. By tradition, no red marcher may stand directly ahead of a blue marcher — that is, the final lineup must not contain the substring "01" anywhere. The organizers fix the lineup with the following process: Each second, every occurrence of the substring "01" in the current lineup is changed to "10" , and all of these changes happen simultaneously. The process repeats second after second and stops as soon as the lineup contains no occurrence of "01" . Determine how many seconds the process takes to stop. Input Format The only line of input contains the binary string color . Output Format Print a single integer — the number of seconds the proc