#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, m, s, a, b, f, c = 0, d, ans, r, test, sum = 0, sum1 = 0, i, j, l,
                       array[100000 + 10];
  string str;
  cin >> r >> a >> b >> c >> d;
  f = d - b;
  l = c - a;
  test = max(f, l);
  ll k = test / (r * r);
  if (r == 1)
    cout << test << endl;
  else
    cout << k << endl;
}
