import Data.Char
main=do
 s<-map digitToInt<$>getLine
 let p=concat$take (length s) (repeat [0,1])
 let q=concat$take (length s) (repeat [1,0])
 print$length$filter(odd)(zipWith (+) s (if head s==0 then p else q)) 