def Appel(arr):
    dobleR = arr[0] * 2
    dx = True
    dy = True
    countX = 0
    countY = 0
    if(arr[3] == arr[1]):
        dx = False
    if(arr[4] == arr[2] ):
        dy = False
    if(dx):
        countX = (arr[3] - arr[1]) / dobleR
    if(dy):
        countY = (arr[4] - arr[2]) / dobleR
    if(dx == False and dy == False):
        return 0
    if(arr[4]%dobleR != 0 or arr[3]%dobleR != 0):
        return int((countX + countY) + 1)
    return(int(countX + countY))

arr=[]
arr = list(map(int, input().strip().split()))

print(Appel(arr))