A,B,X,Y = map(int,input().split()) if A / B > X / Y: print(X * (1 + B / A)) else: print(Y * (1 + A / B))