import sys, math
input = sys.stdin.readline

r, x1, y1, x2, y2 = [int(c) for c in input().split()]

dX = abs(x2-x1)
dY = abs(y2-y1)

move = min(dX,dY)//r
dX -= move*r
dY -= move*r
move += (dX+dY)//(2*r)

print(move)


	
