Var
i, n, a, b,n1: integer;
begin
write('Введите число ');
Readln(n);
n1 := n;
a := n mod 10;
case a of
2, 3: n := n * ((n div 10) mod 10);
7, 8, 9: begin for i := 1 to length(inttostr(n)) do begin b := b + (n mod 10);n := n div 10; end;n := n1 - b; end;
1, 4, 5, 6, 0: n := n div 10;
End;
Write(n);
end.