#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x[3], y[3];
  cin >> r;
  cin >> x[1];
  cin >> y[1];
  cin >> x[2];
  cin >> y[2];
  if ((x[2] - x[1]) == (y[2] - y[1])) {
    cout << (x[2] - x[1]) / r;
  } else {
    for (int i = 1; i <= 2; i++) {
      if (x[i] != 0) {
        cout << (x[i] / r) - 1;
      } else {
        if (y[i] != 0) {
          cout << (y[i] / r) - 1;
        }
      }
    }
  }
  return 0;
}
