#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pp=pair<int,int>;

int main() {
    // ios_base::sync_with_stdio(0); cin.tie(0);
    double sx, sy, ex, ey;
    cin>>sx>>sy>>ex>>ey;
    printf("%.9f", sx+sy*((ex-sx)/(ey+sy)));
    return 0;
}

//:::: Alien :::://
// Muhammad Eid //
#include <bits/stdc++.h>
using namespace std;

void Mo35() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}

int main() {  Mo35();

    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int mx = -2e9;
    for (int x = a; x <= b; ++x) {
        for (int y = c; y <= d; ++y)
            mx = max(mx, x - y);
    }
    cout << mx;

return 0;
}
