def f(a, b, le, tf):

    b[le] = tf

    if le == len(b)-1:

        t = ""

        s1 = 0

        for i in range(len(b)):

            t += a[i]

            if b[i] == 1:

                s1 += int(t)

                t = ""

        t += a[len(b)]

        s1 += int(t)

        return s1

    else:

        return f(a, b, le+1, 0) + f(a, b, le+1, 1)





aa = eval(input())

bb = [0] * (len(aa)-1)

if len(aa) == 1:

    print(aa)

else:

    print((f(aa, bb, 0, 0) + f(aa, bb, 0, 1)))
def clc(a, b, c, p, t):

    if c == 0:

        b = a[0]

        return clc(a, b, c + 1, True, t) + clc(a, b, c + 1, False, t)

    elif c == len(a)-1:

        if p:

            return t + int(b) + int(a[c])

        else:

            return t + int(b + a[c])

    else:

        if p:

            t += int(b)

            b = a[c]

        else:

            b += a[c]

        return clc(a, b, c + 1, True, t) + clc(a, b, c + 1, False, t)





s = eval(input())

print((clc(s, "", 0, True, 0) if len(s) != 1 else s))

def f(a, b, le, tf):
    b[le] = tf
    if le == len(b) - 1:
        t = ""
        s1 = 0
        for i in range(len(b)):
            t += a[i]
            if b[i] == 1:
                s1 += int(t)
                t = ""
        t += a[len(b)]
        s1 += int(t)
        return s1
    else:
        return f(a, b, le + 1, 0) + f(a, b, le + 1, 1)


aa = eval(input())
bb = [0] * (len(aa) - 1)
if len(aa) == 1:
    print(aa)
else:
    print((f(aa, bb, 0, 0) + f(aa, bb, 0, 1)))

def clc(a, b, c, p, t):
    if c == 0:
        b = a[0]
        return clc(a, b, c + 1, True, t) + clc(a, b, c + 1, False, t)
    elif c == len(a) - 1:
        if p:
            return t + int(b) + int(a[c])
        else:
            return t + int(b + a[c])
    else:
        if p:
            t += int(b)
            b = a[c]
        else:
            b += a[c]
        return clc(a, b, c + 1, True, t) + clc(a, b, c + 1, False, t)


s = eval(input())
print((clc(s, "", 0, True, 0) if len(s) != 1 else s))

-def f(a, b, le, tf): -    b[le] = tf -    if le == len(b) - 1: -        t = "" -        s1 = 0 -        for i in range(len(b)): -            t += a[i] -            if b[i] == 1: -                s1 += int(t) -                t = "" -        t += a[len(b)] -        s1 += int(t) -        return s1 +def clc(a, b, c, p, t): +    if c == 0: +        b = a[0] +        return clc(a, b, c + 1, True, t) + clc(a, b, c + 1, False, t) +    elif c == len(a) - 1: +        if p: +            return t + int(b) + int(a[c]) +        else: +            return t + int(b + a[c]) -        return f(a, b, le + 1, 0) + f(a, b, le + 1, 1) +        if p: +            t += int(b) +            b = a[c] +        else: +            b += a[c] +        return clc(a, b, c + 1, True, t) + clc(a, b, c + 1, False, t) -aa = eval(input()) -bb = [0] * (len(aa) - 1) -if len(aa) == 1: -    print(aa) -else: -    print((f(aa, bb, 0, 0) + f(aa, bb, 0, 1))) +s = eval(input()) +print((clc(s, "", 0, True, 0) if len(s) != 1 else s))