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+=x1//(r*2)
    if(x1%2==1):
        ans+=2
else:
    ans+=y1//(r*2)
    if(y1%2==1):
        ans+=2
print(ans)
