import java.util.*;
public final class Main {
	public static void main(String args[]) {
	    
		Scanner in=new Scanner(System.in);
		
	    int n = in.nextInt();
	    int x1 = in.nextInt();
	    int y1 = in.nextInt();
	    int x2 = in.nextInt();
	    int y2 = in.nextInt();
	    System.out.print((Math.abs(x1-x2)+Math.abs(y1-y2))/(n*2));
	    
	    
	    
}}
