'use strict'

const main = (INPUT) => {
  const S = INPUT.split('\n')[0].split('')
  let ans = 0

  for (let i = 0; i < S.length; i++) {
    let tmp = S.slice(i + 1)
    if (S[i] == '1') {
      if (tmp.indexOf('0') >= 0) {
        let j = tmp.indexOf('0') + i + 1
        ans += 2
        S[i] = '9'
        S[j] = '9'
      }
    } else if (S[i] == '0') {
      if (tmp.indexOf('1') >= 0) {
        let j = tmp.indexOf('1') + i + 1
        ans += 2
        S[i] = '9'
        S[j] = '9'
      }
    }
  }
  console.log(ans)
}

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