s = gets
c = 0
loop do 
    if !(s.include?("10")) and !(s.include?("01")) or s.empty? then
        break 
    elsif s.include?("10") then
        s.slice!("10")
        c += 2
    elsif (s.include?("01")) then
        s.slice!("01")
        c += 2
    end
    hoge += 1
end
puts c
