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)
    plus = 0
    if t1//d != t1/d or t2//d != t2/d:
        plus = 1
    ans += t1//d
    ans += t2//d
    print(ans+plus)