#include <bits/stdc++.h>
using namespace std;
struct flist {
  int pos;
  int val;
};
bool acomp(flist a, flist b) { return (a.val < b.val); }
long long floorSqrt(long long x) {
  if (x == 0 || x == 1) return x;
  long long start = 1, end = x, ans;
  while (start <= end) {
    int mid = (start + end) / 2;
    if (mid * mid == x) return mid;
    if (mid * mid < x) {
      start = mid + 1;
      ans = mid;
    } else
      end = mid - 1;
  }
  return ans;
}
using namespace std;
int main() {
  int i, j, k;
  long long r, x, y, x1, y1;
  cin >> r >> x >> y >> x1;
  ;
  cin >> y1;
  ;
  long long movx = 0, movy = 0;
  movx = abs(x - x1) / r;
  if (movx * r != abs(x - x1)) {
    movx++;
  }
  movy = abs(y - y1) / r;
  if (movy * r != abs(y - y1)) {
    movy++;
  }
  if (x == x1 && y == y1) {
    printf("0\n");
    return 0;
  }
  if (movx > 0) {
    movx--;
  }
  if (movy > 0) {
    movy--;
  }
  long long finalmov = movx * movx + movy * movy;
  long long final = floorSqrt(finalmov);
  if (final * final == finalmov) {
    printf("%lld\n", final);
  } else
    printf("%lld\n", final + 1);
}
