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 [] = 0
eater (a:[])  = 0
eater (a:b:[]) = if a == b then 2 else 0
eater (a:b:c:rest) = if a == b then 2 + (eater (c:rest))
                      else if b == c then 2 + (eater (a:rest))
                        else eater (b:c:rest)

main::IO()
main=print.solver=<<getLine