Company: Godaddy_27aug
Difficulty: medium
Zeroing a Binary String You are given a binary string S consisting only of the characters '0' and '1' . You may repeatedly apply the following operation: > Choose any two adjacent characters of the string and replace both of > them with their bitwise XOR. In other words, if you choose positions i and i + 1 and the characters there are a and b , then after the operation the characters at both positions i and i + 1 become a XOR b . The length of the string never changes. Concretely, an operation on an adjacent pair does one of three things: 1 1 becomes 0 0 0 1 becomes 1 1 1 0 becomes 1 1 0 0 becomes 0 0 (an operation that changes nothing) For example, if the string is "1100" and you choose the first two characters, then 1 XOR 1 = 0 , so both of those characters become '0' and the string becomes "0000" . Find the minimum number of operations needed to turn every character of S into '0' . Input Format A single line containing the binary string S . Output Format Print a single integer