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