/*Author LAVLESH*/
import java.util.*;

public class solution {
	
	

	public static void main(String args[])
    {
     Scanner in=new Scanner(System.in) ;
		double r=in.nextInt();
		int x=in.nextInt();
		int y=in.nextInt();
		int x1=in.nextInt();
		int y1=in.nextInt();
	x=Math.abs(x-x1);
	y=Math.abs(y-y1);
	double t=Math.abs(x-y);
	double q=Math.max(x-t,y-t);
    double	ans=t/(2*r)+q/r;		
		System.out.println((int)Math.ceil(ans));
  }
}
