#include <iostream>
#include <math.h>
int main() {
double p, x;
scanf("%lf", &x);
p = (((2*x + 3)*x - 4)*x - 5)*x + 6;
printf("%lf", p);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgoKaW50IG1haW4oKSB7Cglkb3VibGUgcCwgeDsKCXNjYW5mKCIlbGYiLCAmeCk7CgkgICBwID0gKCgoMip4ICsgMykqeCAtIDQpKnggLSA1KSp4ICsgNjsKCXByaW50ZigiJWxmIiwgcCk7CiAgICByZXR1cm4gMDsKfQ==