A,B,C,D = map(int,input().split()) print(min(A,min(D/(C+1),B/C)))