#include<bits/stdc++.h>
using namespace std;
double paixu(double a,double b){
   return (a>b)? a-b:b-a;

}
int main() {
    int a,b,c,d;
    cin>>a>>b >>c>>d;
   double de,dm;
   de=sqrt(pow(a-c,2)+pow(d-b,2));
   dm=paixu(a,c)+paixu(b,d);
   cout<<fixed<<setprecision(16)<<paixu(de,dm);
   
   return 0;

}
// 64 位输出请用 printf("%lld")