import math
R,X,Y,X1,Y1=list(map(int,input().split()))
if(X==X1 and Y==Y1):
    print(0)
elif(X!=X1 or Y!=Y1):
    M=math.sqrt(pow((X1-X),2)+pow((Y1-Y),2))-(R+R)
    if(M==0):
        print(1)
    elif(R==1):
        print(int(M)+1)
    else:
        print(abs(int(M)))
