import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Pins {

    public static void main(String[] args) {
        Kattio io = new Kattio(System.in,System.out);
        long r=io.getInt();
        int x=io.getInt();
        int y=io.getInt();
        int x2=io.getInt();
        int y2=io.getInt();
        long d=
        Math.abs(x)-Math.abs(x2)*(Math.abs(x)-Math.abs(x2))+
        Math.abs(y)-Math.abs(y2)*(Math.abs(y)-Math.abs(y2));
        int answer=0;
    //  io.println("r:"+r+"  d:"+d);
        while(r*r<d){
            //io.println("r:"+r+"  d:"+d);
            answer++;
            r*=r;
            if(r==1)r++;

        }
        io.println(answer);
        io.close();
    }
static class Kattio extends PrintWriter {

    public Kattio(InputStream i) {
    super(new BufferedOutputStream(System.out));
    r = new BufferedReader(new InputStreamReader(i));
    }
    public Kattio(InputStream i, OutputStream o) {
    super(new BufferedOutputStream(o));
    r = new BufferedReader(new InputStreamReader(i));
    }

    public boolean hasMoreTokens() {
    return peekToken() != null;
    }

    public int getInt() {
    return Integer.parseInt(nextToken());
    }

    public double getDouble() { 
    return Double.parseDouble(nextToken());
    }

    public long getLong() {
    return Long.parseLong(nextToken());
    }

    public String getWord() {
    return nextToken();
    }



    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    private String peekToken() {
    if (token == null) 
        try {
        while (st == null || !st.hasMoreTokens()) {
            line = r.readLine();
            if (line == null) return null;
            st = new StringTokenizer(line);
        }
        token = st.nextToken();
        } catch (IOException e) { }
    return token;
    }

    private String nextToken() {
    String ans = peekToken();
    token = null;
    return ans;
    }
}
}
