import java.util.Scanner;

public class Pins {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int r=sc.nextInt();
        int x=Math.abs(sc.nextInt());
        int y=Math.abs(sc.nextInt());
        int x1=Math.abs(sc.nextInt());
        int y1=Math.abs(sc.nextInt());
        int count=0;
        int rx=Math.abs(x-x1);
        int ry=Math.abs(y-y1);
        if(Math.abs(x-x1)>=2*r){
            count+=Math.abs(x-x1)/(2*r);
            rx=Math.abs(x-x1)%(2*r);
        }
        if(Math.abs(y-y1)>=2*r){
            count+=Math.abs(y-y1)/(2*r);
            ry=Math.abs(y-y1)%(2*r);
        }
        if ((rx<=r ||ry<=r)&& (rx!=0 ||ry!=0)) {
            count++;
        }

        System.out.println(count);
            
    }
}