r,x,y,a,b = map(int,input().split())
first = abs(x-a)//(2*r)
second = abs(y-b)//(2*r)
mini = min(first,second)
total= first+second-mini
# print(total)
if(abs(x-a)%(2*r)!=0):
    total+=1
if(abs(y-b)%(2*r)!=0):
    total+=1
print(total)