import math
ans = 0
r, x, y, x1, y1 = map(int, input().split())
y1 = abs(y1-y)
x1 = abs(x1-x)
if(x1>y1):
    ans+=math.ceil(x1/(r*2))
    if(x1%2==1):
        ans+=1
else:
    ans+=math.ceil(y1/(r*2))
    if(y1%2==1):
        ans+=1
print(ans)
