uses crt;
var s,x:longint;
begin
clrscr;
write('x=');readln(x);
if x>=2 then s:=x-2;
if x<2 then s:=2-x;
writeln('S= ',s);
readln
end.
uses crt;
var s,x:longint;
begin
clrscr;
write('x=');readln(x);
if x>=1 then s:=x-1;
if x<1 then s:=1*x;
writeln('S= ',s);
readln
end.