#include <bits/stdc++.h>
int r, x1, y1, x2, y2;
int main() {
  scanf("%d %d %d %d %d", &r, &x1, &y1, &x2, &y2);
  int x = x1 > x2 ? x1 - x2 : x2 - x1;
  int y = y1 > y2 ? y1 - y2 : y2 - y1;
  if ((x + y) % 2 * r != 0)
    printf("%d", ((x + y) / (2 * r)) + 1);
  else
    printf("%d", (x + y) / (2 * r));
  return 0;
}
