#include<iostream>
#include<cmath>
#include<math.h>
using namespace std;

int main()
{
	int n,i;
	long b;
	double x,a,s;
	a=b=1;
	s=1;
	cin>>n;
	cin>>x;
	for(i=1;i<=n;i++){
		
			b=b*i;
			
			 
		
		a=pow(-1,i+1)*pow(x,i)/b;
		s=s+a;
	}
	cout<<s;
	
	return 0;
	
}
