#include<iostream>
#include<cmath>
#include<math.h>
using namespace std;

int main()
{
	double x,y;
	cin>>x;
	if(x<=-1)
		y=2*x+cos(x);
	else if(x>-1&&x<1)
		y=1.0/pow((x+1)*(x+1),1.0/3);
	else
		y=pow(sin(x),2);
	
	cout<<y;
	
	return 0;
}
