#include <iostream>
#include <cmath>
using namespace std;
double cos (double x, double e) {
double x2,c,n,f,z;
x2= x*x;
f= 2;
c= 1;
n= 2;
z= -1;
while ((x2/f)>=e) {
c=c+z*x2/f;
n=n+2;
x2=x2*x*x;
f=f*(n-1)*n;
z=z*(-1);
}
return c;
}
int main() {
double x,e;
cin>>x;
cin>>e;
cout<<cos(x,e)<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+IAp1c2luZyBuYW1lc3BhY2Ugc3RkOwpkb3VibGUgY29zIChkb3VibGUgeCwgZG91YmxlIGUpIHsKCWRvdWJsZSB4MixjLG4sZix6OwogICAgeDI9IHgqeDsKCWY9IDI7CgljPSAxOwoJbj0gMjsKCXo9IC0xOyAKICAgIHdoaWxlICgoeDIvZik+PWUpIHsKCSAJYz1jK3oqeDIvZjsKCQluPW4rMjsKCQl4Mj14Mip4Kng7CgkJZj1mKihuLTEpKm47CgkJej16KigtMSk7CiAgICAgfQogICAgIHJldHVybiBjOwp9CmludCBtYWluKCkgewoJZG91YmxlIHgsZTsKCWNpbj4+eDsKCWNpbj4+ZTsKCgoJY291dDw8Y29zKHgsZSk8PGVuZGw7CglyZXR1cm4gMDsKfQ==