Module Module1

    Dim SS() As String

    Sub Main()
        Dim str = Console.ReadLine
        Dim S(str.Length - 1) As String
        For i As Integer = 0 To str.Length - 1
            S(i) = str.Substring(i, 1)
        Next
        SS = S
        Console.WriteLine(Dfs(0, SS(0)))
    End Sub

    Function Dfs(i As Integer, str As String) As Integer

        If i >= SS.Length - 1 Then
            Dim r As Long = 0
            Dim arr() As String = str.Split("+")
            For Each a As String In arr
                r += a
            Next
            Return r
        End If

        Return Dfs(i + 1, str + SS(i + 1)) + Dfs(i + 1, str + "+" + SS(i + 1))

    End Function

End Module
