#include <iostream.h>
#include<math.h>
const double pi=3.1415926;
double mycos(double);
void main( )
{ double x;
cin>>x;
cout << mycos((x / 180) * pi) << endl;
}
double mycos(double x)
{
double a=1,s=1,sign=1,i;
for(i=2; a>=1e-7; i=i+2)
{
a=a*(x/i)*(x/(i-1));
s=s-sign*a;
sign=-sign; }
return (s);
}
#include <iostream.h>
#include <math.h>
const double pi=3.1415926;
double mycos(double x)
{
int n=1;
double s=0,t=1.0;
while(fabs(t)>=1e-6)
{
s+=t;
t*=(-1)*x*x/(n*(n+1));
n=n+2;
}
return s;
}
void main(){
double x;
cin>>x;
cout<< mycos((x / 180) * pi)<<endl;
}