import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Code507B {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] input = br.readLine().split(" ");
		
		int r = Integer.parseInt(input[0]);
		int x = Integer.parseInt(input[1]);
		int y = Integer.parseInt(input[2]);
		int x_p = Integer.parseInt(input[3]);
		int y_p = Integer.parseInt(input[4]);
		
		int x_move = Math.abs(x - x_p);
		int y_move = Math.abs(y - y_p);
		
		int count = 0;
		
		if(x_move == y_move) {
			count = x_move / r;
			
			if(x_move != 0 && x_move % r != 0)
				count++;
		} else if(x_move > y_move) {
			count = y_move / r;
			
			if(y_move != 0 && y_move % r != 0)
				count++;
			
			count += (x_move - y_move) / (2 * r);
			
			if(x_move != 0 && x_move % r != 0)
				count++;
		} else if(y_move > x_move) {
			count = x_move / r;
			
			if(x_move != 0 && x_move % r != 0)
				count++;
			
			count += (y_move - x_move) / (2 * r);
			
			if(y_move != 0 && y_move % r != 0)
				count++;
		}
		
		System.out.println(count);
		
	}

}
