#include <bits/stdc++.h> using namespace std; double a, b, c, d, x; int main() { cin >> a >> b >> c >> d >> x; cout << fixed << setprecision(7) << a * x * x * x + b * x * x + c * x + d; }