a=int(input()) s=0;p=1 while a>0: b=a%10 s=s+b if b!=0: p=p*b a=a//10 print(p) print(s)