	/**
 * @(#)psv.java
 *
 *
 * @author
 * @version 1.00 2015/11/3
 */
import java.util.*;
import java.io.*;

public class psv {

    public static void main(String [] args) throws IOException{
    	BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st=new StringTokenizer(in.readLine());
    	int r=Integer.parseInt(st.nextToken());
    	int x=Integer.parseInt(st.nextToken());
    	int y=Integer.parseInt(st.nextToken());
    	int x1=Integer.parseInt(st.nextToken());
    	int y1=Integer.parseInt(st.nextToken());
    //	double distance=Math.sqrt(Math.pow(Math.abs(x1-x),2)+Math.pow(Math.abs(y1-y),2));
    	int count=0;
    	int dist_x=Math.abs(x-x1);
    		int dist_y=Math.abs(y-y1);
    //	System.out.println(distance);
    	while(dist_y>0||dist_x>0){
    		//System.out.println(dist_x);
    		if(dist_x>0){

    			dist_x-=r;
    		}else{

    			dist_y-=r*2;
    			count++;
    			continue;
    					}
    			if(dist_y>0)
    			dist_y-=r;
    			else
    				dist_x-=r;
    		//	System.out.println(dist_x);
    		count++;
    	}//System.out.println(dist_x);

    	System.out.println(count);
    }


}