import Data.List

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


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

eat_with_stack::[Bool]->[Bool]->Int
eat_with_stack _ [] = 0
eat_with_stack (x:xs) (y:ys) = if x == y then 2 + (eat_with_stack xs ys) else eat_with_stack (y:x:xs) (ys)

solver::String->Int
solver = (eat_with_stack []).trans