r, x, y, xd, yd = map(int, input().split())
d = 2*r
if x == xd and y == yd:
    print(0)
else:
    ans = 0
    t1 = abs(xd-x)
    t2 = abs(yd-y)
    ans += t1//d
    ans += t2//d
    xd -= d*(t1//d)
    yd -= d*(t2//d)
    if xd > 0 or yd > 1:
        print(ans+1)
    else:
        print(ans)