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