import math
x1, y1, r1 = map(int, input().split())
x2, y2, r2 = map(int, input().split())
d = math.hypot(x2 - x1, y2 - y1)
if d >= r1 + r2:
print(0)
elif d + r1 <= r2:
print(math.pi*r1**2)
elif d + r2 <= r1:
print(math.pi*r2**2)
else:
a1 = math.acos((r1 * r1 + d * d - r2 * r2) / (2 * r1 * d))
a2 = math.acos((r2 * r2 + d * d - r1 * r1) / (2 * r2 * d))
print((a1 - math.sin(2 * a1) / 2) * r1 * r1 + (a2 - math.sin(2 * a2) / 2) * r2 * r2)