#include <stdio.h>
#include <math.h>
int main()
{
double x,y;
scanf("%lf",&x);
if(x < 0)
y = x*x;
else if( x >=0 && x < 10)
y = -0.5 * x + 10;
else
y = x - sqrt(x);
printf("y = %g\n",y);
return 0;
}