#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int r, x1, y1, x2, y2;
  cin >> r >> x1 >> y1 >> x2 >> y2;
  int dx = abs(x1 - x2);
  int dy = abs(y1 - y2);
  int steps = 0;
  if (dx % (2 * r) == 0 && dy % (2 * r) == 0)
    steps = dx / (2 * r) + dy / (2 * r);
  else
    steps = 1 + (dx - r) / (2 * r) + (dy - r) / (2 * r);
  cout << steps << "\n";
  return 0;
}
