X=int(input())
sum_d=0
pr_d=1
whiled>0:
a=x%10
sum_d=sum_d+a
pr_d=pr_d*a
x=x//10
print(sum_d)
print(pr_d)
X=int(input())
sum_d=0
pr_d=1
whiled>0:
a=x%10
sum_d=sum_d+a
pr_d=pr_d*a
x=x//10
print(sum_d)
print(pr_d)