function main(input) {
  var num = replaceLoop(input, 0);

  console.log(num*2);
}

function replaceLoop(input, execNum){
  var index01 = input.indexOf('01');
  var index10 = input.indexOf('10');
  if(index01 === -1 && index10 === -1){
    return execNum;
  }else if(index01 < index10){
    var newstr = input.replace("01", '');
    execNum++;
    return replaceLoop(newstr, execNum);
  }else{
    var newstr = input.replace("10", '');
    execNum++;
    return replaceLoop(newstr, execNum);
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
