#include <fstream>
#include <cmath>

using namespace std;

ifstream fi ("SINx.INP");
ofstream fo ("SINx.OUT");

int giaithua (int a){
  int t=1,i;
  if (a>1){
  for (i=2;i<=a;i++){t=t*i;}

  return t;
}

}
double tinhsin(double a,int e){
  double sinx=0,t;
  int i=1,k=0;
  while ((pow(a,i)/double(giaithua(i)))<=e){
    t=pow(a,i)/double(giaithua(i));
    if (k%2==0){sinx=sinx+t;}
    if (k%2==1){sinx=sinx-t;}
    i+=2;k++;
  }
  return sinx;
}

int main(){
  double x;int e;
  fi>>x>>e;
  fo<<tinhsin(x,e);
  return 0;
}
