#include using namespace std; typedef long long ll; int main() { int a, b, x, y; cin>>a>>b>>x>>y; cout << fixed << (a+b) * min((double)x/a, (double)y/b) << endl; return 0; }