'use strict'
// import bigInt from 'big-integer'

const procBitPatterns = (num, func) => {
    for (let bit = 0; bit < (1 << num); bit++) {
        const bitPatterns = []
        for (let i = 0; i < num; i++) {
            if (bit & (1 << i)) bitPatterns.push(1)
            else bitPatterns.push(0)
        }
        func(bitPatterns)
    }
}


const main = (input) => {
    input = input.trim()
    const nums = input.split("")
    const plusNum = nums.length - 1
    let answer = 0
    procBitPatterns(plusNum, (bitPatterns) => {
        let tmpStrs = [nums[0]]
        for (let j = 0; j < bitPatterns.length; j++) {
            const num = nums[j + 1]
            if (bitPatterns[j]) {
                tmpStrs.push(num)
            } else {
                tmpStrs[tmpStrs.length - 1] += num
            }
        }
        answer += tmpStrs.reduce((acc, cur) => acc + parseInt(cur, 10), 0)
    })

    console.log(answer)
}

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