a,b,x,y=map(int,input().split()) total=a+b print(total*min(x/a,y/b))