import java.util.Scanner;

public class B {
    public static void main(String args[]){
            Scanner in = new Scanner(System.in);            
            long r = 0 , x = 0 , y = 0 , x1 = 0 , y1 = 0 ;
            r = in.nextLong();
            x = in.nextLong();
            y = in.nextLong();
            x1 = in.nextLong();
            y1 = in.nextLong();
            if(x>x1){
                long temp = x ;
                x = x1;
                x1 = temp;
                temp = y;
                y = y1;
                y1 = temp;
            }
            if(y1<y){
                long zarib1 = (x1 - x)/(2*r);
                long zarib2 = (y - y1)/(2*r);
                if(x+(zarib1*2*r)==x1||y-(zarib2*2*r)==y1)
                    System.out.println(zarib1+zarib2);
                else
                    System.out.println(zarib1+zarib2+1);
            }else if(y<=y1){
                long zarib1 = (x1 - x)/(2*r);
                long zarib2 = (y1 - y)/(2*r);
                if(x+(zarib1*2*r)==x1||y+(zarib2*2*r)==y1)
                    System.out.println(zarib1+zarib2);
                else
                    System.out.println(zarib1+zarib2+1);
            }
    }
}
