a,b,x,y=map(float,raw_input().split());print(a+b)*min(x/a,y/b)