#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, a, b, c, d;
  cin >> r >> a >> b >> c >> d;
  int xt = abs(c - a);
  int yt = abs(d - b);
  int c1 = abs(xt - yt) / (2 * r);
  int min = xt < yt ? xt : yt;
  int c2 = min / (r);
  cout << c1 + c2 << endl;
  return 0;
}
