/*************************************************************************
 * Name:
 * NetID:
 * Precept:
 *
 * Description: Calculates the perimeter of a triangle whose coordinates
 * are (0, 0), (in1, in2), and (in3, in4), where in1, in2, in3, and in4
 * are integers on standard input.
 *
 * Example:
 * % java Perimeter
 * 0 3 4 0 CONTROL-D (on Mac) or ENTER CONTROL-Z ENTER (on Windows)
 * 12.0
 * 
 * Remark:
 * Visualize the execution of this code here: http://goo.gl/bSZoVH
 *************************************************************************/

public class Perimeter {
   
    // computes the square function (x^2)
    public static int square(int x) {
        return x * x;
    }
   
    // Euclidean distance between origin and (x, y)
    public static double hypotenuse(int x, int y) {
        double sum = square(x);
        sum += square(y);
        return Math.sqrt(sum);
    }
   
    // first method to execute
    public static void main(String[] args) {
        int xA = StdIn.readInt();
        int yA = StdIn.readInt();
        int xB = StdIn.readInt();
        int yB = StdIn.readInt();
        double perimiter = 0;
        perimiter += hypotenuse(xA-xB, yA-yB);  // length of side AB
        perimiter += hypotenuse(xA, yA);        // length of side OA
        perimiter += hypotenuse(xB, yB);        // length of side OB
        StdOut.println(perimiter);
    }
}