cubes = gets.chomp.split("").map(&:to_i)
count = 0
remove_existed = true
while remove_existed == true && 1 < cubes.length do
  cubes[0..cubes.length - 2].each_with_index do |cube, index|
    remove_existed = false
    puts cubes
    if cube + cubes[index + 1] == 1
      count += 1
      cubes.slice!(index, 2)
      remove_existed = true
    end
    break if remove_existed == true
  end
end

puts count * 2