#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

int main() {
    int x1, y1, x2, y2;
    cin >> x1 >> y1;
    cin >> x2 >> y2;
    double DM = abs(x1 - x2) + abs(y1 - y2);
    double DE = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
    double delta = abs(DM - DE);
    cout << fixed << setprecision(40) << delta << endl;
}
// 64 位输出请用 printf("%lld")