/*   Created by IntelliJ IDEA.
 *   Author: Kunal Srivastav (kunalsrivastav)
 *   Date: 27-07-2021
 *   Time: 21:35
 *   File: AmrAndPins.java
 */

import java.util.Scanner;

/**
 * Question - https://codeforces.com/problemset/problem/507/B
 * */

public class AmrAndPins {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int r = scanner.nextInt();
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        int newX = scanner.nextInt();
        int newY = scanner.nextInt();
        if (newX == x && newY == y) {
            System.out.println(0);
        } else if (newX == x) {
            int totalDifference = Math.abs(newY - y);
            System.out.println(totalDifference / (2 * r));
        } else if (newY == y) {
            int totalDifference = Math.abs(newX - x);
            System.out.println(totalDifference / (2 * r));
        } else {
            int xDifference = Math.abs(newX - x);
            int yDifference = Math.abs(newY - y);
            System.out.println((xDifference + yDifference) / (2 * r));
        }
    }
}