import java.util.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scan = new Scanner(System.in);
		int e=1;
		double t, o=0;
		int n = scan.nextInt();
		double x = scan.nextDouble();
		
		for (int j=1; j<(n+1); j++){
			t=Math.sin(j*x);
			e*=2;
			o+=t/e;
		}
		
		System.out.printf("%1$.6f", o);
	}
}