#include <bits/stdc++.h>
using namespace std;
int x, y, xp, yp, r, dx, dy, dxy, dyx, px, py;
int vabs(int a) {
  if (a >= 0)
    return a;
  else
    return -a;
}
int main() {
  cin >> r >> x >> y >> xp >> yp;
  dx = vabs(x - xp);
  dy = vabs(y - yp);
  dxy = min(vabs(y + dx - yp), vabs(y - dx - yp));
  dyx = min(vabs(x + dy - xp), vabs(x - dy - xp));
  px = ceil(dx / r) + ceil(dxy / (2 * r));
  py = ceil(dy / r) + ceil(dyx / (2 * r));
  ;
  cout << min(px, py) << endl;
  return 0;
}
