#include<iostream>
#include<cmath>
using namespace std;

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