#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x, y, nx, ny, ans = 0;
  cin >> r >> x >> y >> nx >> ny;
  nx = abs(nx - x);
  ny = abs(ny - y);
  x = 0;
  y = 0;
  if (nx == 0 || ny == 0) {
    ans += ceil(max(nx, ny) / (2.0 * r));
  } else if (nx == ny)
    ans += nx;
  else {
    ans += ceil(min(nx, ny) / (r * 1.0));
    nx -= min(nx, ny);
    ny -= min(nx, ny);
    ans += ceil(max(nx, ny) / (2.0 * r));
  }
  cout << ans;
  return 0;
}
