#include <stdio.h>
int main()
{
float x,res;
scanf("%f", &x);
if(x < 0 && x != -3){
res = x*x+x-6;
}else if(x >= 0 && x <= 10 && x != 2 && x != 3){
res = x*x-5*x+6;
}else{
res = x*x-x-1;
}
printf("%.3f", res);
}
#include <stdio.h>
double f(double x) {
double ret;
if (x < 0 && x != -3) {
ret = x*x+x-6;
} else if (x >= 0 && x < 10 && x != 2 && x != 3) {
ret = x*x-5*x+6;
} else {
ret = x*x-x-1;
}
return ret;
}
int main(void) {
double in;
scanf("%lf", &in);
printf("%.3f", f(in));
return 0;
}