#include <stdio.h>
#include <math.h>
int fak(int b){
int z = 1;
for(int i = 2; i<=b; i++)
z*=i;
return z;
}
int main()
{
double x = 0, count = 0;
scanf("%lf", &x);
for(int i = 2; i<=8; i++)
count += pow(x, i) / fak(i);
count += (pow(x, 8) / fak(9)) + x;
printf("%lf", count);
return 0;
}