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

int main() 
{
  long double x[2],y[2];
  cin>>x[0]>>y[0];
  cin>>x[1]>>y[1];
  cout << setprecision(18) <<(fabs(x[0]-x[1]) + fabs(y[0]-y[1]) - hypot(x[0]-x[1], y[0]-y[1])) << endl;
}