str = gets.chomp.split("").map(&:to_i)
state = [0, 0]
ans = 0
str.size.times do |i|
  state[str[i]] += 1
  if state[0]>= 1 && state[1]>=1
    state[0] -= 1
    state[1] -= 1
    ans += 2
  end
end
# puts "#{state}"
puts ans