input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
S = lines.shift().split('')
cnt = 0
p = S[S.length-1]
for (i=S.length- 2; i>=0; i--) {
    if ((p == 0 && S[i] == 1) || (p == 1 && S[i] == 0)) {
        cnt += 2
        S.splice(i, 2)
    }
    p = S[i]
}
console.log(cnt)
