//package pkg507b;
import java.util.*;
public class Main 
{

    public static void main(String[] args) 
    {
        Scanner sc=new Scanner(System.in);
        int r=sc.nextInt();
        int x1=sc.nextInt();
        int y1=sc.nextInt();
        int x2=sc.nextInt();
        int y2=sc.nextInt();
        int num1=0;
        int num2=0;
        if((x2-x1)!=0 && (y2-y1)!=0)
        {
            num1=Math.abs((x2-x1)/r);
            num2=Math.abs((y2-y1)/r);
            if(Math.abs((x2-x1))%r!=0)
            {
                num1++;
            }
            if(Math.abs(y2-y1)%r!=0)
            {
                num2++;
            }
            x2=x2-x1;
            y2=y2-y1;
        }
        if((x2-x1)!=0 && (y2-y1)==0)
        {
            num1=num1 + Math.abs((x2-x1)/(2*r));
             if(Math.abs((x2-x1))%r!=0)
            {
                num1++;
            }
                        x2=x2-x1;

        }
        if((x2-x1)==0 & (y2 - y1)!=0)
        {
            num2=num2+ Math.abs((y2-y1)/(2*r));
            if(Math.abs(y2-y1)%r!=0)
            {
                num2++;
            }
            y2=y2-y1;

        }
        System.out.println(Math.max(num1,num2));
    }
    
}
