#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x1, y1, x2, y2;
  cin >> r >> x1 >> y1 >> x2 >> y2;
  int ans = 0;
  int t = 2 * r;
  int diff = (y2 - y1) + (x2 - x1);
  if (diff % t == 0)
    ans = (((y2 - y1) + (x2 - x1)) / t);
  else
    ans = (((y2 - y1) + (x2 - x1)) / t) + 1;
  cout << ans;
  return 0;
}
