
import java.awt.Point;
import java.util.Scanner;


public class Main {
   
    public static void main(String [] args){
        Scanner sc=new Scanner(System.in);
        int r=sc.nextInt();
        Point oldCenter=new Point(sc.nextInt(),sc.nextInt());
        Point newCenter=new Point(sc.nextInt(),sc.nextInt());
        int diff=0;
        if(oldCenter.y==newCenter.y){
            diff=Math.abs(oldCenter.x-newCenter.x)/(2*r);
        }
        else if(oldCenter.x==newCenter.x){
             diff=Math.abs(oldCenter.y-newCenter.y)/(2*r);
        }
        else{
            diff=Math.max(Math.abs(oldCenter.y-newCenter.y)/(r),Math.abs(oldCenter.x-newCenter.x)/(r));
        }
        System.out.println(diff);
    }
}
