#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x0, x1, y0, y1, mx, mn, cont = 0;
  cin >> r >> x0 >> y0 >> x1 >> y1;
  mx = max(abs(x0 - x1), abs(y0 - y1));
  mn = min(abs(x0 - x1), abs(y0 - y1));
  if (mn >= 2 * r) {
    cont += mn / (2 * r);
    mn %= (2 * r);
    cont += mx / (2 * r);
    mx %= (2 * r);
  } else if (mx >= 2 * r && mn < 2 * r) {
    cont += mx / (2 * r);
    mx %= (2 * r);
  }
  if (mn > 0 && mx > 0) {
    if (mn == r && mx == r)
      cont++;
    else
      cont += 2;
  } else if (mn > 0) {
    if (mn == r)
      cont++;
    else
      cont += 2;
  } else if (mx > 0) {
    if (mx <= r)
      cont++;
    else
      cont += 2;
  }
  cout << cont << endl;
}
