program sumaCifre;
var n, spare, simp, cif:integer;
begin
write('n='); read(n);
spare:=0; simp:=0;
while (n>0) do
begin
cif:=n mod 10;
if (cif mod 2=0) then spare:=spare+cif
else simp:=simp+cif;
n:=n div 10;
end;
writeln('suma cifrelor pare= ',spare);
writeln('suma cifrelor impare= ', simp);
end.