#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <climits>
#include <vector>
#include <numeric>
#include <complex>
#include <map>
#include <bitset>
using namespace std;

//#define __int64 long long
#define long __int64
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
const int Vecy[4] = {0,-1,0,1};
const int Vecx[4] = {1,0,-1,0};


int main(){
	int a,b,c,d;
	double ans;
	cin >> a >> b >> c >> d;
	if(a * d == b * c){
		ans = c + d;
	}else if(a * d > b * c){
		ans = c + (double(c) * b / a);
	}else{
		ans = d + (double(d) * a / b);
	}
	
	cout.precision(13);
	cout << fixed << ans << endl;
	
    
    return 0;
}