#!/bin/ruby

str = gets.chomp.to_s

flag = true
remove_cnt = 0
cnt = 0
data = {"0"=> 0, "1" => 0}
(str.length).times do |i|
  if str[i] == "0"
    data["0"] += 1
  elsif str[i] == "1"
    data["1"] += 1
  end
end
tmp_ans = data["0"] - data["1"]
tmp_ans = -tmp_ans if tmp_ans < 0
puts str.length - tmp_ans
