#include <iostream>
#include <math.h>
using namespace std;
int main() {
double x,n,s=0;
cin>>n>>x;
for (int i=0; i<n; i++){
s+=(x=sin(x));
}
cout<<"S="<<s;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cglkb3VibGUgeCxuLHM9MDsKCWNpbj4+bj4+eDsKCWZvciAoaW50IGk9MDsgaTxuOyBpKyspewoJCXMrPSh4PXNpbih4KSk7Cgl9Cgljb3V0PDwiUz0iPDxzOwp9