#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x, x2, y, y2, ans = 0;
  cin >> r >> x >> y >> x2 >> y2;
  r *= 2;
  x2 = abs(x - x2);
  y2 = abs(y - y2);
  y2 % r == 0 ? ans += (y2 / r) : ans += (y2 / r + 1);
  x2 % r == 0 ? ans += (x2 / r) : ans += (x2 / r + 1);
  (max(x2, y2) - min(x2, y2) > 0 && y2 != 0 && x2 != 0) || (x2 == y2 && x2 != 0)
      ? cout << ans - 1
      : cout << ans;
}
