# coding: utf-8
# (C) 2015, Laybson Plismenn / UFCG

import math

coord = map(int, raw_input().split())
hipo = math.sqrt((coord[3] - coord[1])**2 + (coord[4] - coord[2])**2)
if hipo == int(hipo):
    ans = int(hipo + 1 - coord[0] * 2)
else:
    ans = int(math.ceil(hipo)-coord[0]*2)

if ans < 0:
    print 0
else:
    print ans
