a, b, x, y = list(map(int, input().split())) if a*(b/a) > y: print(x + x*(b/a)) else: print(y + y*(a/b))