"use strict";

const main = arg => {
    let N = arg.split("\n")[0];  
    let cnt = 0;
  
    while(N.match(/01/)) {
        N = N.replace("01", "");
        cnt += 2;
    }
    
    while(N.match(/10/)) {
        N = N.replace("10", "");
        cnt += 2;
    }
    
    console.log(cnt);
}

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