#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x, y, x1, y1;
  int tempx, tempy, tempdiff;
  int answer = 0;
  scanf("%d %d %d %d %d", &r, &x, &y, &x1, &y1);
  tempx = abs(x - x1);
  tempy = abs(y - y1);
  if (tempx > tempy) {
    int step = 2 * r;
    int hamada = (tempx - tempy) / step;
    answer = answer + hamada;
    answer = answer + tempy;
  } else if (tempy > tempx) {
    int step = 2 * r;
    int hamada = (tempy - tempx) / step;
    answer = answer + (hamada);
    answer = answer + tempx;
  } else {
    answer = answer + tempx;
  }
  printf("%d\n", answer);
  return 0;
}
