{Pascal ABC.NET}
var a,b,s,y:integer;
x,c:integer;
begin
a:=-0.0025;
b:=-2.7;
c:=3;
read(x);
if x<=-2 then write(((a*a*b)/9)-abs(x))</p>
else if (x>-2) and (x<4) then write(4*(a*a*a*x*x-c*c))</p>
else begin
s:=(a*a-2*a*b+b*b)+x*x;
y:=tan(s);
write(y);
end;
end.