inp = raw_input().split()
r = int(inp[0])
x = int(inp[1])
y = int(inp[2])
X = int(inp[3])
Y = int(inp[4])
inc = 2*r
s1 = (Y-y)/inc
s2 = (X-x)/inc
n = ((s2*inc)!=(X-x))
m = ((s1*inc)!=(Y-y))
step = s1+s2
if(n or m):
    step +=1
print step
