fun main(arg: Array<String>) {
    val S = next()
    val N = S.length - 1
    val e = Eval()
    var ans = 0L
    for (b in 0 until 1.shl(N)) {
        val P = BooleanArray(N)
        for (n in 0 until N) {
            if (b.shr(n).and(1) == 1) P[n] = true
        }
        val Ex = StringBuilder()
        for (n in 0 until N) {
            Ex.append(S[n])
            if (P[n]) Ex.append('+')
        }
        Ex.append(S.last())
        ans += e.eval(Ex.toString())
    }


    println(ans)
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)
fun listOfLong() = listOfString().map(String::toLong)
fun listOfInt(delta: Int = 0) = listOfString().map { Integer.parseInt(it) + delta }


class Eval {
    private val num_list = java.util.ArrayList<Long>()
    private val ope_list = java.util.ArrayList<Char>()
    private fun _list_init() {
        num_list.clear()
        ope_list.clear()
    }
    private fun _lexical_analysis(formula: String) {
        val sequenceList = formula.toCharArray()
        var set_num = 0L
        for (token in sequenceList) {
            if ("+-*/".indexOf(token) > -1) {
                ope_list.add(token)
                num_list.add(set_num)
                set_num = 0L
            } else if ("123456789".indexOf(token) > -1) {
                set_num *= 10L
                set_num += (token - '0').toLong()
            }
        }
        num_list.add(set_num)
    }
    fun _calculation(): Long {
        var num1_num: Long
        var num2_num: Long
        var set_num: Long
        var num1_id: Int
        var num2_id: Int
        var hit_id: Int
        var hit_count = 0
        for (token in ope_list) {
            hit_id = -1
            if (token == '*' || token == '/') {
                hit_id = ope_list.indexOf(if (token == '*') '*' else '/')
                ope_list[hit_id] = '@'
                num1_id = hit_id - hit_count
                num2_id = hit_id - hit_count + 1
                num1_num = num_list[num1_id]
                num2_num = num_list[num2_id]
                set_num = if (token == '*') num1_num * num2_num else num1_num / num2_num
                num_list[num1_id] = set_num
                num_list.removeAt(num2_id)
                hit_count++
            }
        }
        while (ope_list.remove('@')) { }
        for (token in ope_list) {
            num1_id = 0
            num2_id = 1
            num1_num = num_list[num1_id]
            num2_num = num_list[num2_id]
            set_num = num1_num + if (token == '+') num2_num else -num2_num
            num_list[num1_id] = set_num
            num_list.removeAt(num2_id)
        }
        return num_list[0]
    }

    fun eval(formula: String): Long {
        var anser = 0L
        _list_init()
        _lexical_analysis(formula)
        anser = _calculation()
        return anser
    }
}