#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
const long long N = 3e5;
const long long mod = 1e9 + 7;
const long long M = 1009;
void sout() { cout << "\n"; }
template <typename T, typename... Types>
void sout(T var1, Types... var2) {
  cout << var1 << " ";
  sout(var2...);
}
template <typename T>
void sout(vector<T> arr) {
  for (auto it : arr) {
    cout << it << " ";
  }
  sout();
}
void test_case() {
  long long r, x, y, a, b;
  cin >> r >> x >> y >> a >> b;
  long long temp = pow(2, abs(x - y)) + pow(2, abs(a - b));
  temp = sqrt(temp);
  long long ans = temp / r;
  cout << ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  long long t = 1;
  while (t--) {
    test_case();
  }
}
