import Data.List

solver::String->Int
solver = eater.(map (\ (i,b) -> if (mod i 2 == 0) then b else (not b)  ) ).(zip [0..]).(map (\ c -> (c == '0') ))



eater::[Bool]->Int
eater bs = let grpd = group bs in
           let ev = (sum.(map length).filter (\ ls -> mod (length ls) 2 == 0)) grpd in
           let od = (sum.(map (\ ls -> 2*(div (length ls) 2))).group.concat.(filter (\ ls -> mod (length ls) 2 /= 0))) grpd in
           ev+od
main::IO()
main=print.solver=<<getLine