#include <bits/stdc++.h>
using namespace std;
int r, x, y, xx, yy;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> r >> x >> y >> xx >> yy;
  cout << (max(x, xx) - min(x, xx) + max(y, yy) - min(y, yy)) / (2 * r) << endl;
  return 0;
}
