'''
def main():
    from sys import stdin,stdout
if __name__=='__main__':
    main()
'''
#401
'''
def main():
    import sys
    a,b=map(int,sys.stdin.readline().split())
    if a>b:
        if a-b==1:
            s=''
            for i in range(a+b):
                if i&1:
                    s+='1'
                else:
                    s+='0'
        else:
            s='-1'
    elif b>a:
        if b<=2*(a+1):
            s=''
            if b-a==1:
                for i in range(a+b):
                    if i&1:
                        s+='0'
                    else:
                        s+='1'
            else:
                n=b-a-1
                i=0
                flag=0
                while i<a+b:
                    if flag&1:
                        s+='0'
                    else:
                        if n:
                            s+='11'
                            n-=1
                            i+=1
                        else:
                            s+='1'
                    i+=1
                    flag=~flag
        else:
            s='-1'
    else:
        s=''
        for i in range(a+b):
            if i&1:
                s+='1'
            else:
                s+='0'
    sys.stdout.write(s)
if __name__=='__main__':
    main()
'''
#508B
'''
def main():
    import sys
    n=sys.stdin.readline().strip()
    lodd=int(n[-1])
    odd=0
    even=0
    s=''
    j=0
    for i in n:
        if ord(i)&1:
            odd+=1
        else:
            even+=1
            feven=int(i)
            feindex=j
            if(feven<lodd):
                break
        j+=1
    if even:
        for i in range(len(n)):
            if i==feindex:
                sys.stdout.write(n[-1])
            elif i==len(n)-1:
                sys.stdout.write(str(feven))
            else:
                sys.stdout.write(n[i])
    else:
        sys.stdout.write('-1')
if __name__=='__main__':
    main()
'''
#447B
'''
def main():
    import sys
    s=sys.stdin.readline().strip()
    n=int(sys.stdin.readline())
    tup=tuple(map(int,sys.stdin.readline().split()))
    maxim=max(tup)
    score=0
    for i in range(len(s)):
        score+=(i+1)*tup[ord(s[i])-97]
    d=n*(2*len(s)+n+1)//2
    score+=maxim*d
    sys.stdout.write(str(score))
if __name__=='__main__':
    main()
'''
#507B
def main():
    from sys import stdin,stdout
    from math import ceil
    r,x,y,a,b=map(int,stdin.readline().split())
    d=ceil((b-y+a-x)/(2*(r)))
    stdout.write(str(d))
if __name__=='__main__':
    main()
