def dfs(i, f):

    if i == n - 1:

        return sum(list(map(int, f.split("+"))))

    return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1])



s = eval(input())

n = len(s)



print((dfs(0, s[0])))
# -*- coding: utf-8 -*-



S = eval(input())

n = len(S)



def dfs(i, f):

    # 文末？の最後まで行ったらreturn

    if i == n - 1:

        return f

    # +を入れるか入れないか

    return dfs(i + 1, f + S[i + 1]) + "+" + dfs(i + 1, f + "+" + S[i + 1])



def main():

    print((eval(dfs(0,S[0]))))



if __name__ == '__main__':

    main()
def dfs(i, f):
    if i == n - 1:
        return sum(list(map(int, f.split("+"))))
    return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1])


s = eval(input())
n = len(s)
print((dfs(0, s[0])))

# -*- coding: utf-8 -*-
S = eval(input())
n = len(S)


def dfs(i, f):
    # 文末？の最後まで行ったらreturn
    if i == n - 1:
        return f
    # +を入れるか入れないか
    return dfs(i + 1, f + S[i + 1]) + "+" + dfs(i + 1, f + "+" + S[i + 1])


def main():
    print((eval(dfs(0, S[0]))))


if __name__ == "__main__":
    main()

-def dfs(i, f): -    if i == n - 1: -        return sum(list(map(int, f.split("+")))) -    return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1]) +# -*- coding: utf-8 -*- +S = eval(input()) +n = len(S) -s = eval(input()) -n = len(s) -print((dfs(0, s[0]))) +def dfs(i, f): +    # 文末？の最後まで行ったらreturn +    if i == n - 1: +        return f +    # +を入れるか入れないか +    return dfs(i + 1, f + S[i + 1]) + "+" + dfs(i + 1, f + "+" + S[i + 1]) + + +def main(): +    print((eval(dfs(0, S[0])))) + + +if __name__ == "__main__": +    main()