# -*- coding: utf-8 -*- A, B, X, Y = map(int, input().split()) if A/X*B <= Y: print(X+X/A*B) else: print(Y+Y/B*A)