import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeSet;
import java.util.concurrent.LinkedBlockingDeque;

import javax.swing.border.Border;

public class a {


    private static class Pair implements Comparable<Pair> {
        int f;
        int s;

        Pair(int f,int s) {
            
            this.f = f;
            this.s = s;
        }

        @Override
        public int compareTo(Pair o) {
            return (f-o.f);
        }

    }



    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        String s[]= in.readLine().split(" ");
        int r=Integer.parseInt(s[0]);
        int x=Integer.parseInt(s[1]);
        int y=Integer.parseInt(s[2]);
        int xx=Integer.parseInt(s[3]);
        int yy=Integer.parseInt(s[4]);
        int diam=r*2;
        int dist1=Math.abs(xx-x);
        int dist2=Math.abs(yy-y);
        int sum =dist1%diam + dist2%diam;
        int res=dist1/diam + dist2/diam + sum/diam +(sum%diam)/r;
        out.println(res);

        out.close();

    }
}