# -*- coding: utf-8 -*- A, B, X, Y = map(float, raw_input().split()) C = min(X / A, Y / B) print A * C + B * C