#include<cstdio> int main() { double x,a,b,c,d; scanf("%lf%lf%lf%lf%lf",&x,&a,&b,&c,&d); double f=a*x*x*x+b*x*x+c*x+d; printf("%.7lf",f); }