#include #include #include using namespace std; int main() { double x,coef,result=0,deg=0; cin >> x; while(1) { cin >> coef; if(cin.eof()) { cout << setprecision(4) << fixed << result << endl; return 0; } result += coef*pow(x,deg++); } }