#include <iostream>
#include <cmath>
using namespace std;
double func(double x)
{
return 6 * pow(x,2) + abs(x-3) - 15;
}
signed main() {
double x;
cin >> x;
cout << func(x);
#include <iostream>
#include <cmath>
using namespace std;
double func(double x)
{
return 6 * pow(x,2) + abs(x-3) - 15;
}
signed main() {
double x;
cin >> x;
cout << func(x);
}