#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x, y, x1, y1;
  cin >> r >> x >> y >> x1 >> y1;
  x1 -= x;
  y1 -= y;
  int diag = min(x1, y1);
  int ans = diag / r;
  diag = abs(x1 - y1);
  ans += diag / (2 * r);
  cout << ans;
}
