import java.util.Scanner;


public class Main {

    
    public static void main(String[] args) {
        Scanner exp1 = new Scanner(System.in);
           int r=exp1.nextInt();
           int x1=exp1.nextInt();
           int y1=exp1.nextInt();
           int x2=exp1.nextInt();
           int y2=exp1.nextInt();
           int dx=0,dy=0;
           if (x1>=x2)
            dx=x1-x2;
           else
               dx=x2-x1;
           if(y1>=y2)
           dy=y1-y2;
           else
               dy=y2-y1;
           int all=dx+dy;
           int m=2*r;
           int res=all/m;
           

           System.out.println(res);

    }

}
