temparr = input()
temparr = temparr.split()
r = int(temparr[0])
x1 = int(temparr[1])
y1 = int(temparr[2])
endx = int(temparr[3])
endy = int(temparr[4])
import math
eachturn = r * 2 
eachturnn =  r * 2
minx = min(x1, endx)
maxx = max(x1, endx)
miny = min(y1, endy)
maxy = max(y1, endy)
ans = 0 
diff = abs(maxx - minx) + abs(maxy - miny)
#print(diff)
while diff:
    eachturn = eachturn
    print(eachturn)
    if diff % eachturn == 0 :
        rm = diff // eachturn
        ans += rm 
        break 
    if diff > eachturn:
        diff -= eachturn
        ans += 1 
        continue 
    else:
        flag = 1 
        ans += 1
        if flag == 1:
            break 
        
print(ans)
            
        





