import sys input=lambda: sys.stdin.readline().rstrip() a,b,x,y=map(int,input().split()) if x*b/a<=y: print(x*(a+b)/a) else: print(y*(a+b)/b)