#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
#include<queue>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for (int i=0;i<(n);++i)
using ll = long long;
using namespace std;
using P = pair<int,int>;
#define INF 100000

int main(){
    double si,sj,gi,gj;
    cin>>si>>sj>>gi>>gj;
    sj = -sj;
    double k = (sj-gj)/(si-gi);
    double ans = (-gj)/k +gi;
    cout<<fixed<<setprecision(10)<<ans<<endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define N 510
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int i,n,a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<max(a,b)-min(c,d);
}