const input = require('fs').readFileSync('/dev/stdin', 'utf8');
 
const string = input.split('');
 
let num1 = 0;
 
let num0 = 0;
 
str.forEach((i) => {
  if (i === '1') {
    num1++;
  } else {
    num0++;
  }
})

console.log(string.length);
console.log(num1);
console.log(num0);
 
if (num1 < num0) {
  console.log(num1 * 2);
} else {
  console.log(num0 * 2);
}