program t implicit none integer::A,B,C,D read*,A,B,C,D print"(i0)",min(D/(C+1),A,B/C) end program t