#include <bits/stdc++.h>
using namespace std;
int main() {
  long r, x, y, x1, y1;
  cin >> r >> x >> y >> x1 >> y1;
  long minx = abs((x1 - x) / r);
  long minsx = floor(minx);
  long miny = abs((y1 - y) / r);
  long minsy = floor(miny);
  long min = (minsx + minsy) / 2;
  cout << min << endl;
  return 0;
}
