#include<iostream>
#include<cmath>
using namespace std;
double y(double x)
{
	double t;
	if(x<=0)
		t=sin(x)+1;
	else if(x>0&&x<10)
		t=x*x+3/x;
	else
		t=sqrt(x+4);
		return t;
 } 
int main()
{
	double t,a;
	cin>>a;
	t=y(a);
	cout<<t;

	return 0;
}
