from decimal import Decimal as D a,b,x,y=map(D,input().split()) v=D("0") if x*b/a<=y: v=x+x*b/a if y*a/b<=x: v=max(v,y+y*a/b) print(v)