import math
class Point:
    def __init__(self, A, B):
        self.x = A
        self.y = B

class Line:
    def __init__(self, A, B):
        self.point_A = A
        self.point_B = B

class Circle:
    def __init__(self, A, B):
        self.O = A
        self.r = B

def getDistance(circle, l):
    # 请在这里实现你的代码
    x0, y0, r, x1, y1, x2, y2 = (circle.O.x, circle.O.y, circle.r, l.point_A.x, l.point_A.y, l.point_B.x, l.point_B.y)
    
    A, B,C = y2- y1, x1 - x2, x2 * y1 - x1 * y2
    d = abs(A * x0 + B * y0 + C) / (A ** 2 + B ** 2) ** 0.5
    if d < r:
        return 2 * (r ** 2 - d ** 2) ** 0.5
    else:
        return 0










































































































































































































def main():
    ox, oy, r = map(float, input().split())
    x1, y1, x2, y2 = map(float, input().split())
    
    center = Point(ox, oy)
    circle = Circle(center, int(r))
    
    p1 = Point(x1, y1)
    p2 = Point(x2, y2)
    l = Line(p1, p2)
    
    result = getDistance(circle, l)
    print("{:.6f}".format(result))

if __name__ == "__main__":
    main()