input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
S = lines.shift()
cnt = 0
while(m = S.match(/(01|10)/g)) {
    cnt += m.length * 2
    S = S.replace(/(01|10)/g, '')
}
console.log(cnt)
