my_input = map(int,raw_input().split())

r = my_input[0]
x = my_input[1]
y = my_input[2]
a = my_input[3]
b = my_input[4]


total = abs(a-x) + abs(b-y)

if total == 0 :
    print 0
else :
    total -= 2*r
    move = 1
    if total > 0 :
        move += total/ 2*r

    print move
