/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package amr;

import java.util.Scanner;

/**
 *
 * @author Admin
 */
public class Amr {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int radius = s.nextInt();
        int x1 = s.nextInt();
        int y1 = s.nextInt();
        int x2 = s.nextInt();
        int y2 = s.nextInt();
        int steps=0;
        int dis=(x2-x1)+(y2-y1);
        if(x2-x1 == y2-y1 && y2-y1>0)
            steps=(x2-x1)/radius;
        else if(x2-x1 == y2-y1 && y2-y1<0)
            steps=-1*(x2-x1)/radius;
        else if(x2-x1 == y2-y1 && y2-y1 ==0)
            steps=0;
        else { while(dis>0){
            dis=dis-radius;
            steps++;
        }
        steps--;}
        
        System.out.println(steps);
    }
    
}
