n,x,y,X,Y=map(int,input().split())
'''
diff_x=abs(X-x)
diff_y=abs(Y-y)
diff=max(diff_x,diff_y)
value=[]
for c in range(diff+1):
	a=(diff_x-c)/(2*n)
	b=(diff_y-c)/(2*n)
	v=abs(a)+abs(b)+abs(c)
	value.append(v)
print(int(min(value)))
'''
distance=((X-x)**2+(Y-y)**2)**(0.5)

#distance=4
#n=1
#print(distance)
if distance==0:
	print(0)
if 0<distance<=n:
	print(1)
x=(distance-n)//(2*n)
y=(distance-n)%(2*n)

if 0<=y<=n and distance>n:
	print(int(1+x))
if y>n and distance>n:
	print(int(2+x))