import math
def f(u, t):
if (u < 2 * t):
m = u ** (-1) - t ** (-1)
return m
elif (u > 2 * t):
m = (u - t) ** 2
return m
else:
m = (2 * u + 5 * t) / 3
return m
x = float(input("x: "))
y = float(input("y: "))
z1 = f(math.fabs(math.log(x) + y) ,math.sin(y - x) / math.acos(x / y))
z2 = math.cos(math.sqrt(f(math.exp(y), (2 * x - 1) ** 3)))
z3 = math.tan(f(y / x, math.asin(x / y)))
print(z1 + z2 + z3)