#include <iostream>
#include <cmath>
using namespace std;
 
int main() 
{
    int e=1, n;
    double x, t, o=0;
    
    cin >> n >> x;

    for (int j=1; j<(n+1); j++)
    {
		t=sin(j*x);
		e*=2;
		o+=t/e;
    }
    
    cout << fixed << o;
    
    return 0;
}