import math
r,x,y,x1,y1 = [int(x) for x in input().split(" ")]

val = math.ceil(((x1-x) + (y1-y))/(r*math.sqrt(2)))
val1 = math.ceil((x1-x)/r)
val2 = math.ceil((y1 - y)/r)

if val % 2 == 0:
    val = (val // 2)
else:
    val = ((val + 1) // 2)

if val1 % 2 == 0:
    val1 = val1 // 2
else:
    val1 = (val1 + 1) // 2
    
if val2 % 2 == 0:
    val2 = val2 // 2
else:
    val2 = (val2 + 1) // 2

print(max(val1,val2,val))