#include <bits/stdc++.h>
using namespace std;
pair<int, int> ar[3];
int main() {
  int r, x, y, x1, y1;
  cin >> r >> x >> y >> x1 >> y1;
  if (x == x1 && y == y1) {
    cout << 0 << endl;
    return 0;
  }
  ar[0].first = x, ar[0].second = y;
  ar[1].first = x + r, ar[1].second = y;
  ar[2].first = x, ar[2].second = y + r;
  long long mini = 999999999999;
  for (int i = 0; i < 3; i++) {
    long long raiz = ((x1 - ar[i].first) * (x1 - ar[i].first)) +
                     ((y1 - ar[i].second) * (y1 - ar[i].second));
    raiz = sqrt(raiz);
    mini = min(raiz / r, mini);
  }
  cout << mini << endl;
}
