#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  ;
  long long r, x1, y1, x2, y2;
  cin >> r >> x1 >> y1 >> x2 >> y2;
  long long an = (y2 - y1) / (2 * r) + (x2 - x1) / (2 * r);
  if ((y2 - y1) % (2 * r) || (x2 - x1) / (2 * r))
    cout << an + 1;
  else
    cout << an;
  return 0;
}
