<?php
//error_reporting(0);
$S = trim(fgets(STDIN));
//list($A,$B,$K) =  explode(" ",trim(fgets(STDIN)));
//$A = explode(" ",trim(fgets(STDIN)));
$len = strlen($S);
while(1) {
  $wk = $S;
  $wk = str_replace("01","",$wk);
  if ($S==$wk) {
    $wk = str_replace("10","",$wk);
    if ($S==$wk) break;
  }
  $S = $wk;
}
printf("%d\n",$len - strlen($wk),$wk);
