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