#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x, y, xx, yy;
  cin >> r >> x >> y >> xx >> yy;
  if (x == xx && y == yy) {
    cout << ceil((abs((xx) - (x)) + abs((yy) - (y))) / ceil(2 * r));
  } else if (x != xx && y != yy) {
    cout << ceil((abs(abs(xx) - abs(x)) + abs(abs(yy) - abs(y))) / ceil(2 * r));
  } else if (x == xx && y != yy) {
    cout << ceil((abs((xx) - (x)) + abs(abs(yy) - abs(y))) / ceil(2 * r));
  } else if (x != xx && y == yy) {
    cout << ceil((abs(abs(xx) - abs(x)) + abs((yy) - (y))) / ceil(2 * r));
  }
}
