var
i,n,a,s,d:integer;
s1:lonint;
begin
write(' nhap a : ); readln(a);
s1:=0;s:=0;
while a <> 0 then
begin
s:= s + a mod 10;
a:= a div 10;
n:= n +s;
inc(d);
if s1 = 0 then s1:= s1 + s else
s1:= s1 * 10 + s;
s:=0;
end;
writeln(' chu so :',d);
writeln(' tong : ',n);
write(' dao nguoc: ',s1);
readln
end.