import math
a=raw_input()
r,x,y,w,z=map(int,a.split())

if w-x==0:
    if abs(z-y)==r:
        print 1
        exit(0)
    else:
        if abs(z-y)%2*r==0:
            print abs(z-y)/(2*r)
            exit(0)
        else:
            print abs(z-y)/(2*r) +1
            exit(0)

if z-y==0:
    if abs(w-x)==r:
        print 1
        exit(0)
    else:
        if abs(w-x)%2*r==0:
            print abs(w-x)/(2*r)
            exit(0)
        else:
            print abs(w-x)/(2*r) +1
            exit(0)
angle=math.atan((z-y)/(w-x))
ans=1
#print angle
while ((w-x)**2 + (z-y)**2)**1/2>2*r:
    x+=r*2*math.cos(angle)
    y+=r*2*math.cos(angle)
    #print x,y
    ans+=1

#if  ((w-x)**2 + (z-y)**2)**1/2==2*r:
 #   ans+=1
#elif ((w-x)**2 + (z-y)**2)**1/2==2*r:
 #   ans+=1
    
print ans
