#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
    int x1, y1 , x2, y2;
    cin >> x1 >> y1;
    cin >> x2 >> y2;
    double de = sqrt((x1-x2)*(x1-x2)*1.0+(y1-y2)*(y1-y2)*1.0);
    double dm = abs((x1-x2)*1.0) + abs((y1-y2)*1.0);
    double total = abs(dm - de);
    printf("%.7f",total);
}
// 64 位输出请用 printf("%lld")