#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long r, x, y, a, b;
  cin >> r >> x >> y >> a >> b;
  long long cnt = (abs(x - a) / (2 * r)) + (abs(y - b) / (2 * r)) +
                  max((abs(x - a) % (2 * r)), (abs(y - b) % (2 * r)));
  cout << cnt;
  return 0;
}
