#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x, y, x1, y1;
  cin >> r >> x >> y >> x1 >> y1;
  int c = 0;
  while (x < x1) {
    x += r;
    c++;
  }
  int i = 0;
  while (y < y1) {
    y += r;
    i++;
  }
  if (i > c)
    cout << i;
  else
    cout << c;
  return 0;
}
