r=io.read;while""do a=r(4)x=((4*a^2+3*r()^2)^.5-a)/3+.5;print(x-x%1)end