var
temp,n,pr,c,first,sum:integer;
begin
ReadLn(N);
temp:=n;
if N<>0 then
pr:=1
else
pr:=0;
sum:=0;
c:=0;
while temp<>0 do
begin
inc(sum, temp mod 10);
pr:=pr*(temp mod 10);
inc(c);
if temp div 10 = 0 then
first:=temp mod 10;
temp:=temp div 10
end;
WriteLn(c,' ',sum,' ',pr,' ',first);
ReadLn
end.