#include
int main()
{double x,y;
scanf("%lf",&x);
if(x<0)y=x*x-1;
else if(x<1)y=x*x;
else y=x*x+1;
printf("%g",y);
return 0;
}
#include
int main()
{double x,y;
scanf("%lf",&x);
if(x<0)y=x*x-1;
else if(x<1)y=x*x;
else y=x*x+1;
printf("%g",y);
return 0;
}