arr = str(input())
import math
arr = arr.split()
r = int(arr[0])

x1 = int(arr[1])
y1 = int(arr[2])

x2 = int(arr[3])
y2 = int(arr[4])

if x1 == x2 and y1 == y2:
    print("0")
elif x1 == x2:
    if y1 + r >= y2:
        print("0")
    else:
        diff = y2 - y1 
        ans = math.ceil( diff/ r)
        print(ans - 1 )

elif y1 == y2 :
    if x1 + r >= x2:
        print("0")
    else:
        diff = x2 - x1 
        ans = math.ceil( diff/ r)
        print(ans - 1)
else:
    
    diffx = x2 - x1 
    diffy = y2 - y1 
    ansx = math.ceil( diffx / r )
    ansy = math.ceil( diffy / r )
    
    ans1 = max(ansx, ansy)
    #print(ansx)
    #print(ansy)
    print(ans1 )
    
    
    
    
        
        
        
        