# -*- coding: utf-8 -*- A,B,X,Y = map(int, input().split()) # Yをすべて使う if X/A >= Y/B: print(Y+Y/B*A) # Xをすべて使う else: print(X+X/A*B)