#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, x, y, nx, ny;
  cin >> r >> x >> y >> nx >> ny;
  int count = 0;
  if (nx == x && ny == y) count = -1;
  if ((nx - x) > 2 * r) count += (nx - x) / 2 * r;
  if ((ny - y) > 2 * r) count += (ny - y) / 2 * r;
  cout << count + 1 << endl;
}
