import math

def floatRange(start, stop, step):
    i = start
    while i < stop:
        yield i
        i += step

class Point:
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y

    def squareDistTo(self, point):
        return (self.x-point.x)**2 + (self.y-point.y)**2

class UnitCircle:
    def __init__(self, center=Point(0,0)):
        self.center = center

    def __contains__(self, point):
        return self.center.squareDistTo(point) < 1.0

    def overlappingArea(self, other):
        if self.center.squareDistTo(other.center) >= 2:
            return 0
        inSelf = inBoth = 0
        for i in floatRange(-1.0, 1.0, 0.002):
            for j in floatRange(-1.0, 1.0, 0.002):
                p = Point(self.center.x + i, self.center.y + j)
                if p in self:
                    inSelf += 1
                    if p in other:
                        inBoth += 1
        return math.pi * inBoth / inSelf

if __name__ == '__main__':
    x, y, u, w = [float(s) for s in raw_input().split()]
    a = UnitCircle(Point(x,y))
    b = UnitCircle(Point(u,w))
    print 2*math.pi - a.overlappingArea(b)
