#include < iostream >
#include < cmath >
using namespace std;
double func(double x)
{
return pow(x,3) - 3.5 * pow(x,2) + 2;
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
double x;
cin >> x;
cout << func(x);
#include < iostream >
#include < cmath >
using namespace std;
double func(double x)
{
return pow(x,3) - 3.5 * pow(x,2) + 2;
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
double x;
cin >> x;
cout << func(x);
}