import java.util.*;

class dash {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        float x = in.nextFloat();
        float y = in.nextFloat();
        float a=x*x+y*y;

        if((y<0)||(a>1)||((x>0)&&(a<0.3)))
        {
            System.out.format("u=%f", Math.sqrt(Math.abs(x-1)));
        } else
        {
            System.out.format("u=%f",x*x-1);
        }
    }
}