#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x, y, x2, y2;
  cin >> r >> x >> y >> x2 >> y2;
  int md = abs(x2 - x) + abs(y2 - y);
  if (md % (2 * r) == 0)
    cout << md / (2 * r);
  else
    cout << int(md / sqrt(2 * r)) / 2;
  return 0;
}
