#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x1, y1, x2, y2, a, b;
  cin >> r;
  cin >> x1 >> y1;
  cin >> x2 >> y2;
  a = (x2 - x1);
  b = (y2 - y1);
  int l = a < b ? a : b;
  cout << l / r << endl;
  return 0;
}
