const chunks = [];
process.stdin.on("data", (chunk) => {
  chunks.push(chunk);
});
process.stdin.on("end", () => {
  const input = Buffer.concat(chunks).toString("utf8").trim();
  console.log(solve(input));
});

function solve(S) {
  let diff = 0;
  for (let i = 0; i < S.length; i++) {
    if (S[i] === "0") {
      diff++;
    } else if (S[i] === "1") {
      diff--;
    }
  }
  return Math.abs(diff);
}
