<?php
  $s = trim(fgets(STDIN));
  $count = 0;
  $i=0;
  while($i < strlen($s)-1){
      if($s[$i].$s[$i+1] == "10" || $s[$i].$s[$i+1] == "01"){
          $s = substr($s, 0, $i).substr($s, $i+2);
          $count += 2;
          $i = 0;
          continue;
      }
      $i++;
  }
  echo $count;