#!/bin/ruby

str = gets.chomp.to_s

flag = true
remove_cnt = 0
cnt = 0
while flag
  (str.length).times do |i|
    cnt += 1
    if str[i] == "0" && i > 0 && str[i-1] == "1"
      str.slice!(i-1)
      str.slice!(i-1)
      remove_cnt += 2
      break
    end
    if str[i] == "0" && i < str.length - 1 && str[i+1] == "1"
      str.slice!(i)
      str.slice!(i)
      remove_cnt += 2
      break
    end
    if i == str.length - 1
      flag = false
    end
  end
end
puts remove_cnt
