import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class codeforces{

    public static int solve(int r,int x1,int y1,int x2,int y2){
        int turns=0;
        x2-=x1;y2-=y1;x1=0;y1=0;
        x2=Math.abs(x2);
        y2=Math.abs(y2);
        int d1=Math.abs(x1-x2);
        int d2=Math.abs(y1-y2);
        if(d1<d2)
        turns+=((d2-d1)/(2*r));
        else
        turns+=((d1-d2)/(2*r));
        return turns+(Math.min(d1,d2)/r);
    }

    public static void main(String[] args) throws IOException {
        InputStreamReader isr=new InputStreamReader(System.in);
        BufferedReader br=new BufferedReader(isr);
        // StringBuilder str=new StringBuilder();
        PrintWriter out=new PrintWriter(System.out);
        // int n=Integer.parseInt(br.readLine());
        String[] lol=br.readLine().split(" ");
        int r=Integer.parseInt(lol[0]);
        int x1=Integer.parseInt(lol[1]);
        int y1=Integer.parseInt(lol[2]);
        int x2=Integer.parseInt(lol[3]);
        int y2=Integer.parseInt(lol[4]);
        out.println(solve(r,x1,y1,x2,y2));
        out.close();
    }
}