object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val datS = readLine.split("").filterNot(_.isEmpty).map(_.toInt).reverse

    import math.pow
    val combNum = pow(2, (datS.length - 1)).toInt

    var sum: Long = datS(0) * combNum
    for (i <- 1 until datS.length) {
      for (j <- 1 to (i + 1)) {
        val sum_ = datS(i) * pow(10, j - 1).toLong * (combNum >> j)
        if ((combNum >> j) == 0) sum += datS(i) * pow(10, j - 1).toLong
        if (j == (i + 1)) sum += sum_ * 2
        else sum += sum_
        //println("i=" + i + " j=" + j + " S=" + datS(i) + " sum_=" + sum_)
      }
    }

    val ans = sum
    println(ans)
  }
}
