#include <iostream>
#include <cmath>
using namespace std;
 
int main() {
    float x, y, u;
    scanf("%f%f", &x, &y);
    float a=x*x+y*y;
    if((y<0)||(a>1)||((x>0)&&(a<0.3)))
    {
        printf("u=%f", sqrt(abs(x-1)));
    }
    else
    {
        printf("u=%f",x*x-1);
    }
 
    return 0;
}