import java.util.*;
public class solution{
	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		int rad=in.nextInt();
		int x=in.nextInt();
		int y=in.nextInt();
		int x1=in.nextInt();
		int y1=in.nextInt();
		int xd=x1-x,yd=y1-y;
		int com=xd;
		if(x>x1)
		xd=x-x1;
		if(y>y1)
		yd=y-y1;
		if(xd>yd)
		com=yd;
		int moved=com/(rad);
		if(com%rad!=0)
		moved++;
		xd-=com;
		yd-=com;
		int left=xd;
		if(xd==0)
		left=yd;
		moved+=left/(rad*2);
		if(left%rad!=0)
		moved+=2;
		System.out.println(moved+"");
		
}
}