#include <bits/stdc++.h>
#include <cmath>
#define rep(i,n)    for(int i=0;i<(n);++i)
#define repA(i,k,n) for(int i=k;i<=(n);++i)
#define repD(i,k,n)	for(int i=k;i>=(n);--i)
#define endl '\n'
#define print(b)	for(auto a:b) cout<<a<<' ';
#define printN(b)   for(auto a:b) cout<<a<<endl;
#define fin    		freopen("C:\\Users\\Nazmul Rahul\\Desktop\\in.txt", "r++", stdin)
#define fout   		freopen("C:\\Users\\Nazmul Rahul\\Desktop\\out.txt", "w++", stdout)
#define fastio    	ios::sync_with_stdio(false)
#define max(a,b)	((a)>(b)?(a):(b))
#define min(a,b)	((a)<(b)?(a):(b))
#define pb    		push_back
#define pob   		pop_back
#define ll 			long long int
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
	fin;
	fout;
#endif
	// pair<int, string>p;
	// p = {1, "rahul"};
	// cout << p.first << " " << p.second << endl;
	// pair<pair<int, string>, int>q;
	// int i = 8;
	// q = {{i, "rahul"} , i};
	// cout << q.first.first << endl << q.first.second << endl << q.second << endl;
	// vector<pair<int, string>>p;
	// p.push_back({3, "r"});
	// p.push_back({4, "a"});
	// for (int i = 0; i < p.size(); i++)
	// 	cout << p[i].first << endl << p[i].second << endl;
	// for (auto a : p)
	// 	cout << a.first << endl << a.second << endl;
	int sx, sy, gx, gy;
	cin >> sx >> sy >> gx >> gy;
	float x = abs(sx - gx);

	if (sx > gx) {
		float ans = float(sx) - (x * (float)sy) / ((float)sy + (float)gy);
		// cout << ans << endl;
		printf("%f\n", ans );

	}
	else {
		float ans = float(sx) + (x * (float)sy) / ((float)sy + (float)gy);
		printf("%f\n", ans );
	}



	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll mod=1000000007;
ll fact[200000];
ll power(ll x,ll y)
{
    ll res=1;
    while(y)
    {
        if(y&1) res=(res*x)%mod;
        x=(x*x)%mod; y>>=1;
    }
    return res;
}
ll nCr(ll n,ll r){
    if(r>n) return 0;
    else if(r<0) return 0;
    else if(r==0||r==n)return 1;
    ll ans=fact[n];
    ans=(ans*power(fact[n-r],mod-2))%mod; ans=(ans*power(fact[r],mod-2))%mod;
    return ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    ll t=1;
   // cin>>t;
    for(ll tc=0;tc<t;tc++)
    {
       ll a,b,c,d;
       cin>>a>>b>>c>>d;
       ll ans=-1e9;
       for(ll i=a;i<=b;i++){
        for(ll j=c;j<=d;j++){
            ans=max(ans,i-j);
          }
       }
       cout<<ans<<endl;
    }
    
    
    return 0;
}