r, x, y, X, Y = map(int, raw_input().split())

diff_X = abs(x - X)
diff_Y = abs(y - Y)

r *= 2

if (diff_X == diff_Y == 0):
  print 0
elif (diff_X == 0 or diff_Y == 0):
  print diff_X / r if (diff_X != 0) else diff_Y / r
else:
  print max(diff_X, diff_Y)