#include <bits/stdc++.h>

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,double e){
  double sinx=0,t;
  int i=1,k=0;
  while (abs((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, e;
  fi>>x>>e;
  fo<<fixed<<setprecision(4)<<tinhsin(x,e);
}
