n = input()
ls = [int(x) for x in n]
add = 0
mul = 1
for i in ls:
    mul *= i
for i in ls:
    add += i
print(mul - add)

a40eeb2a34de0f9d3709737840e76016d073623c
<mask token>

<mask token>
for i in ls:
    mul *= i
for i in ls:
    add += i
print(mul - add)

n = input()
ls = [int(x) for x in n]
add = 0
mul = 1
for i in ls:
    mul *= i
for i in ls:
    add += i
print(mul - add)
