r1,x,y,a,b=map(int,raw_input().split())

difx=abs(x-a)
dify=abs(y-b)

ans=0

if(difx<=dify):
	r=2*r1
	p=difx/r1
	ans+=difx/r1
	difx=difx-p*r1
	dify-=p*r1
	
	if(dify>=r):
		p=dify/r
		ans+=p	
		dify-=p*r
		
	if(dify==0 and difx==0):
		print ans
	else:
		print ans+1
else:
	r=2*r1
	p=dify/r1
	ans+=dify/r1
	dify=dify-p*r1
	difx-=p*r1
	
	if(difx>=r):
		p=difx/r
		ans+=p
		difx-=p*r

	if(dify==0 and difx==0):
		print ans
	else:
		print ans+1

