import java.util.*;
import java.lang.*;
import java.io.*;

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in = new Scanner(System.in);
		double x,n,s=0;
		n=in.nextDouble();
		x=in.nextDouble();
		for (int i=0; i<n; i++){
			s+=(x=Math.sin(x));
		}
		System.out.printf("S = %f",s);
	}
}